%% ejercicio 1
clear all
close all
clc

A = quad(@jardin, 0, 10, 1e-6);
sacos = ceil(A*0.025/0.01)

%% ejercicio 2.1
clear all
close all
clc

k = linspace(0.1,0.5,100);
figure(1)
plot(k,Fkappa(k))

kappa = fzero(@Fkappa,[0.1 0.5], optimset('TolX',1e-10))
kappa2= fzero(@Fkappa,0.25, optimset('TolX',1e-10))

t =linspace(16,20);
figure(2)
plot(t,Tfunc(t))

tmuerte = fzero(@Tfunc, [16 20], optimset('TolX',1e-10))

%% Ejercicio Adicional 2
clear all
close all
clc

x = -3:.01:3;
plot(x,exp(x-x.^2), 'r')
hold on
plot(x, atan(x.^2),'b')
legend('exp(x-x^2)', 'arctan(x^2)')

x1 = fzero(@(x) exp(x-x.^2)-atan(x.^2),-1, optimset('TolX',1e-10))
x2 = fzero(@(x) exp(x-x.^2)-atan(x.^2),1, optimset('TolX',1e-10))

A1 = quad(@(x) atan(x.^2)-exp(x-x.^2), -3,x1,1e-6)
A2 = quad(@(x) exp(x-x.^2)-atan(x.^2), x1,x2,1e-6)
A3 = quad(@(x) atan(x.^2)-exp(x-x.^2), x2,3,1e-6)
At1 = A1 + A2 + A3
At2 =  quad(@(x) abs(atan(x.^2)-exp(x-x.^2)), -3,3,1e-6)

%% Ejercicio adicional 3
clear all
close all
clc
x= -3:.01:3;
plot(x, flab7(x), 'r')
hold on
plot(x, zeros(length(x),1),'k')
x1 = fzero(@flab7, 1, optimset('TolX', 1e-10))
x2 = fzero(@flab7, 2, optimset('TolX', 1e-10))
x3 = fzero(@flab7, 3, optimset('TolX', 1e-10))





