2013 URTARRILA
1.
a)

f[x_]=Cos[x]+(1/4)-Exp[x]

CountRoots[f[x],x]

Plot[f[x],{x,-50,5}]

erro negatiboak infinitu
erro positiboak 1

b) BISEKZIOA [-2,-1]
i<50 && f-ren balio absolutua<10^(-6)

For[a=-2.;b=-1.;i=1;tol=10^(-6);err=tol+1,i<50&&err>tol,i++,c=(a+b)/2;If[f[a]*f[c]<0,b=c,a=c];err=Abs[f[c]];Print[i," garren iterazioan tartea [",a,",",b,"] eta errorea = ",err]]

FindRoot[f[x],{x,-1.5}]

2. LAPLACE

eku1=x''[t]==-x[t]+y[t]

eku2=y''[t]==x[t]-y[t]

sistrans=LaplaceTransform[{eku1,eku2},t,s]/.{x[0]->1,y[0]->-1,x'[0]->0,y'[0]->0}

lys=LaplaceTransform[y[t],t,s]

lxs=LaplaceTransform[x[t],t,s]

soltrans[s_]=Solve[sistrans,{lys,lxs}]//Simplify

y1[s_]=-(s/(2+(s^2)))

y1[t_]=InverseLaplaceTransform[y1[s],s,t]

x1[s_]=(s/(2+(s^2)))

x1[t_]=InverseLaplaceTransform[x1[s],s,t]

Plot[{x1[t],y1[t]},{t,0,2Pi}]