# Blatt 6
# Aufgabe 6.1
restart;
p := x -> a*x^2 + b*x + c;
sol := solve({p(1)=1, p(2)=p(0), p(3)=2*p(4)}, {a,b,c});
psol := eval(p(x), sol);
plot(psol, x=-1..5);
restart;
fn := (x/n)*exp(-x/n);
P := [seq(fn, n=1..20)];
plot(P, x=0..10);
with(plots):
animate(plot, [fn, x=0..10], n=1..20, frames=20);
restart;
f := (x,y) -> 2*x + y;
g := (x,y) -> x*y/(x^2+y^2);
plot3d(f(x,y) + 5*g(x,y), x=-5..5, y=-5..5);
plot3d(f(x,y)*g(x,y), x=-5..5, y=-5..5);
plot3d(g(2*x,3*y), x=-5..5, y=-5..5);
plot(g(cos(t),sin(t)), t=-5..5);