# Lab sheet 1

Exercise 2.1

2+2;

(3+7+10)*(1000-8)/(900+90+2)-17;

Exercise 2.2

6^20 * 15^20 / 9^20;

(10^10 - 1)/99;

(10^10-10-9^2)/9^2;

(10^9+1)*(10^10-10-9^2)/9^2;

Exercise 2.3

1+1/2+1/3+1/4;

ev(%,numer);

vals: [3+1/7,3+1/(7+1/15), 3+1/(7+1/(15+1/(293)))];

ev(vals,numer);

ev(map(lambda([x],x-%pi),vals),numer);

Exercise 2.4

fpprec;

fpprec: 4997;

bfloat(%e);

fpprec: 16$;

Exercise 2.5

fpprec: 40$;

x: exp(%pi * sqrt(163));

y:bfloat(x);

printf(true,"~h",y)$;

z: round(y);

z - y;

kill(x,y,z);

Exercise 3.1

A: (x^2-4*y^2)/(x^3-x*y^2);

factor(A);

expand(A);

kill(A)$;

Exercise 3.2

y: 2*x/(x^2-1) + 1/(x + x^2) + 1/(x-x^2);

ratsimp(y);

Exercise 4.1

wxplot2d(sin(x),[x,-4,4]);

y: x - x^3/6 + x^5/120 - x^7/5040;

wxplot2d([sin(x),y],[x,-4,4]);

kill(y)$;

Exercise 5.1

solve([x^2+y^2=1,(x-1)^2+(y-1)^2=1],[x,y]);

wxdraw(gr2d(
  nticks=100,
  proportional_axes='xy,
  color=blue,
  parametric(cos(t),sin(t),t,0,2*%pi),
  color=red,
  parametric(cos(t)+1,sin(t)+1,t,0,2*%pi),
  color=black,point_type=7,point_size=1,
  points([[0,1],[1,0]])
));

Exercise 6.1

diff(log(log(log(x))),x);

factor(diff((3*x+4)/(2*x+3),x));

expand(diff((1+x^2+x^4/2)*exp(-x^2),x));

integrate(sqrt(1-x^2),x,0,1);