Blatt 9 --- Arbeiten mit Mathematica---

Aufgabe 9/1

a) Beispiele

1/1 a)

f[x_]:=(x^2)(1-3x)
f'[x]
Simplify[f'[x]]

1/1 e)

f[x_]:=(2^(Sin[3x]))
f'[x]

b) f(x)=((sin x)/x)

f[x_]:=Piecewise[{{1,x==0},{Sin[x]/x,x!=0}}]
Plot[{f[x],Abs[1/x]},{x,-5π,5π}, PlotRange->{-0.25,1.05},PlotStyle->{{Thick,Red}, Blue}]

f'[x]
FindRoot[Tan[x]==x,{x,1.1π}]
FindRoot[Tan[x]==x,{x,1.6π}]
FindRoot[Tan[x]==x,{x,2.6π}]
Plot[{10*f'[x],10*f[x], Tan[x],x},{x,0,5π},PlotRange->{-5,15},PlotStyle->{{Thick,Red}, {Thick,Black},{Orange},Blue}]

f''[x]
FindRoot[2 Cot[x]==(2/x)-x,{x,0.5π}]
FindRoot[2 Cot[x]==(2/x)-x,{x,1.5π}]
FindRoot[2 Cot[x]==(2/x)-x,{x,2.5π}]
Plot[{10*f''[x],10*f'[x], 2 Cot[x],(2/x)-x},{x,0,5π},PlotRange->{-15,5},PlotStyle->{{Thick,Red}, {Thick,Black},{Orange},Blue}]

c)

f[x_]:=(x+1)*Exp[−x]
funktion=Plot[f[x],{x,-2,10}];
Manipulate[
fl:=a+f[a];
rechteck=Graphics[{RGBColor[0,1,0,.5],Rectangle[{0,0},{a,f[a]}]}];
Show[{rechteck,funktion},Axes->True,PlotRange->{-1,1}]
,{a,0,10}]

d)

2/2 m)

Integrate[(x^4)+3x(Sqrt[x])-2+(4/(x^2)),x]

2/4 k)

Integrate[Sin[x] Exp[x],x]

2/5 l)

Integrate[((Log[x]+1)/x),x]

2/6 e)

Refine[Integrate[(x^m)Exp[-x],{x,0,∞}],Assumptions-> {m>0,m ∈ Integers}]

e)

3/4 f)

Clear[t]
f[x_]:=Exp[x]Sin[x]
t[x_]=Normal[Series[f[x],{x,π/2,3}]]
Plot[{f[x],t[x]},{x,0,3.5}]

h)

6/3 a)

f[x_]:=x^2

A[n_]=(2/(2π))Simplify[Integrate[f[x]Cos[n x],{x,-π,π}],Assumptions->Element[n,Integers]]

B[n_]=(2/(2π))Simplify[Integrate[f[x]Sin[n x],{x,-π,π}],Assumptions->Element[n,Integers]]

A0=(1/(2π))Integrate[f[x],{x,-π,π}]

FourierTrigSeries[f[x],x,5]

Plot[{
f[x],
A0+Sum[A[n]*Cos[n x]+B[n]Sin[n x],{n,1,5}]},{x,-π,π},
PlotStyle->{{Thick,Blue},{Thick,Red}}]

b)

f[x_]:=x

A[n_]=(2/(2π))Simplify[Integrate[f[x]Cos[n x],{x,-π,π}],Assumptions->Element[n,Integers]]

B[n_]=(2/(2π))Simplify[Integrate[f[x]Sin[n x],{x,-π,π}],Assumptions->Element[n,Integers]]

A0=(1/(2π))Integrate[f[x],{x,-π,π}]

Plot[{
f[x],
A0+Sum[A[n]*Cos[n x]+B[n]Sin[n x],{n,1,5}]},{x,-π,π},PlotStyle->{{Thick,Blue},{Thick,Red}}]

c)

f[x_]:=Piecewise[{{π+x,x<0},{π-x,x>=0}}]

A[n_]=(2/(2π))Simplify[Integrate[f[x]Cos[n x],{x,-π,π}],Assumptions->Element[n,Integers]]

B[n_]=(2/(2π))Simplify[Integrate[f[x]Sin[n x],{x,-π,π}],Assumptions->Element[n,Integers]]

A0=(1/(2π))Integrate[f[x],{x,-π,π}]

Plot[{
f[x],
A0+Sum[A[n]*Cos[n x]+B[n]Sin[n x],{n,1,5}]},{x,-π,π},PlotStyle->{{Thick,Blue},{Thick,Red}}]

j)

7/3

i[t_]:=(α t-((α (t^2))/4))*(Exp[-λ t])
α=0.5;λ=0.7;
Plot[i[t],{t,0,10},PlotRange->All]

q[t]=Integrate[i[l],{l,0,t}]
Plot[%,{t,0,10},PlotRange->All]

Aufgabe 9/2

a = 106; c = 1283; m = 6075;

Anz = 20000;
f[x_] := Mod[a*x + c, m];
list = NestList[f, 3, 3*Anz];
ev = Table[ {list[[3 n - 2]], list[[3 n - 1]], list[[3 n]]}/Sqrt[list[[3 n - 2]]^2 + list[[3 n - 1]]^2 + list[[3 n]]^2], {n, 1, Anz}];

ListPointPlot3D[ev]

g[x_]:=μ*x*(1-x);
μ=0.5;
pl={};
For[μ=0.1,μ<=4,μ+=0.1,
	l1=NestList[g,0.9,50];
	l2=NestList[g,0.5,50];
	l3=NestList[g,0.3,50];
	AppendTo[pl,ListPlot[{l1,l2,l3},PlotRange->{0,1}]]
]

pl

pl={};
For[μ=0.1,μ<=4,μ+=0.1,
	l1=NestList[g,0.9,5000];
	AppendTo[pl,Histogram[l1,100]]
]

pl