# Grafica de las funciones más elementales

## Funciones polinómicas:

```t=linspace(-2,2,200);
plot(t,t,t,t.^2,t, t.^3);
title('x , x^2, x^3','fontsize',16)
h=legend('x','x^2','x^3');
grid on
set(h,'fontsize',16)
```

```t=linspace(-3,3,200);
t0=linspace(0,3,200);
plot(t0,sqrt(t0),t,abs(t).^(1/3).*sign(t));
title('x^{1/2}, x^{1/3}','fontsize',16)
h=legend('x^{1/2}','x^{1/3}',2);
grid on
```

## 1/x, 1/x^2

```t=linspace(-3.01,3,200);
plot(t,1./t)
title('1/x','fontsize',16)
ylim([-4,4])
xlim([t(1),t(length(t))])
```
```plot(t,1./t.^2);
title('1/x^2','fontsize',16)
ylim([-1,4])
xlim([t(1),t(length(t))])
grid on
```

## Valor absoluto

```t=linspace(-3,3,200);
plot(t,abs(t));
title('|x|','fontsize',16)
grid on
```

## Funciones trigonométricas: seno, cos, tag

```t=linspace(-2*pi,2*pi,200);
plot(t,sin(t),t,cos(t));
title('sen(t),cos(t)','fontsize',16)
h=legend('sen(t)','cos(t)');
grid on
set(h,'fontsize',16)
set(gca,'xtick',[-2*pi,-3/2*pi, -pi, -pi/2, 0,pi/2, pi,3*pi/2 2*pi])
set(gca,'xticklabel',...
{'-2*pi';  '-3pi/2'; '-pi'; '-pi/2'; '0'; 'pi/2';  'pi'; '3pi/2'; '2 pi'})
xlim([t(1),t(length(t))])
```
```t=linspace(-pi,pi,500);
plot(t,tan(t))
ylim([-6,6]);
grid on
title('tan(t)','fontsize',16)
set(gca,'xtick',[ -pi, -pi/2, 0,pi/2, pi])
set(gca,'xticklabel',{ '-pi'; '-pi/2'; '0'; 'pi/2';  'pi'})
```

## Funciones inversas trigonométricas: arcoseno, arcocoseno, arcotangente

```t=linspace(-1,1,200);
plot(t,asin(t),t,acos(t));
grid on
title('arcsen(t),arccos(t)','fontsize',16)
h=legend('arcsen(t)','arccos(t)');
set(h,'fontsize',16)
set(gca,'ytick',[  -pi, -pi/2, 0,pi/2,pi])
set(gca,'yticklabel',{ '-pi'; '-pi/2'; '0'; 'pi/2' ; 'pi'})
```
```t=linspace(-12,12,200);
plot(t,atan(t));
grid on
title('arctag(t)','fontsize',16)
set(gca,'ytick',[  -1.5, 0,1.5])
set(gca,'yticklabel',{ '-pi/2'; '0'; 'pi/2'})
```

## logaritmo y exponencial

```t=linspace(-2,2,200);
t0=linspace(0.0001,2,200);
plot(t,exp(t),t0,log(t0));
grid on
title('e^t, log(t)','fontsize',16)
h=legend('e^t','log(t)',2);
set(h,'fontsize',16)
t=linspace(-8,8,200);
```