# Lab sheet 9

Exercise 1

x_1:sin(θ)*sin(φ);  x_2: sin(θ)*cos(φ); x_3: cos(θ);

trigsimp(x_1^2+x_2^2+x_3^2);

kill(x_1,x_2,x_3)$

Exercise 2

u: 8 - (x-y)^2*(x+y)^2*(16-4*x^2-y^4);

ut: trigsimp(subst([x=2*cos(t),y=2*sin(t)],u));

expand(demoivre(expand(exponentialize(ut))));

kill(u,ut)$

Exercise 3

solve([a*x+b*y+c*z=1,a*y+b*z+c*x=1,a*z+b*x+c*y=1],[x,y,z]);

Exercise 4

sol: x=find_root(x^4+sin(x)=10^4,x,9,11);

kill(sol)$

Exercise 5

f(x) := (exp(x)+x^7)/(exp(x)-x^7);

ev(f(5),numer);

ev(makelist(f(n),n,0,50),numer);

kill(f)$

Exercise 6

wxdraw2d(
    ip_grid=[100,100],
    proportional_axes=xy,
    implicit(x^4+y^4=4,x,-2,2,y,-2,2),
    color=red,
    nticks=200,
    parametric((2+sin(8*t))*cos(t),(2+sin(8*t))*sin(t),t,0,2*%pi)
);

Exercise 7

wxplot2d([tan(%pi*x),cot(%pi*x),-1,1],[x,-4,4],[y,-2,2],[same_xy],[legend,"tan(πx)","cot(πx)","-1","1"]);

Exercise 8

f(t) := ((2+sqrt(3))*t-1)/(2+sqrt(3)+t);
g(t) := f(f(f(t)));
h(t) := g(g(t));

factor(g(t));

factor(h(t));

kill(f,g,h)$

Exercise 9

y:sin(10*x);

(diff(y,x,8)/y)^(1/8);

kill(y)$

Exercise 10

wxplot2d(makelist(n^(3/2)*x^n*(1-x)^2,n,1,10),[x,0,1],[legend,false]);

Exercise 11

y:x^4*(1-x)^4/(1+x^2);
Y: integrate(y,x);
Y1:integrate(y,x,0,1);
dydx: factor(diff(y,x));

wxplot2d(y,[x,0,1]);

x0: find_root(dydx=0,x,0.4,0.6);
y0: subst(x=x0,y); 

kill(y,Y,Y1,dydx,x0,y0)$

Exercise 12

a(n) := ev((1+1/n)^n/%e,numer);

makelist(a(n),n,1,100);

first(sublist(makelist(n,n,1,100),lambda([n],a(n)>0.99)));