Differentialgleichungen

DirectionField[DE_,y_[x_],{x_,a_,b_},{y_,c_,d_},options___]:=Module[{g},
g=DE[[2 ]]/.y[x]->y;
VectorPlot[{1,g},{x,a,b},{y,c,d},options]
]

Hausaufgabe

DE=y'[x]==-((y[x])/x)+(x^2)+4

DSolve[{DE,y[1]==(13/4)},y[x],x]

plot1=DirectionField[DE,y[x],{x,0.25,3},{y,0,10},Frame->True]

plot2=Plot[Evaluate[y[x]/.DSolve[{DE,y[1]==(13/4)},y[x],x][[1]]],{x,0.1,5},PlotStyle->{Thickness[0.005],RGBColor[1,0,0]}]

Show[plot1,plot2,PlotRange->{0,10}]

Linear transformierte Differentialgleichungen

Beispiel 2.4

DE=y'[x]==(((2x+y[x]))^2)

DSolve[DE,y[x],x]

nach Transformation

DE2=u'[x]==2+(((u[x]))^2)

DSolve[DE2,u[x],x]

Einsetzen der selbst bestimmten Lösung:

lösung=y[x]->(Sqrt[2])Tan[(Sqrt[2])(x+C)]-2x

DE/.{lösung,D[lösung,x]}

DE/.{lösung,D[lösung,x]}//Simplify

Bernoullische Differentialgleichung

Clear[f,g,a]

DE=y'[x]==f[x]y[x]+g[x]((y[x])^a)

DSolve[DE,y[x],x]

f[x_]:=(4/x);g[x_]:=1;a=(1/2);

DSolve[DE,y[x],x]

f[x_]:=(1/x);g[x_]:=(1/(x^3));a=2;

DSolve[DE,y[x],x]

Orthogonaltrajektorien

plot1=Plot[Evaluate[Table[(Sqrt[x+C]),{C,-3,3}]],{x,-3,5},PlotStyle-> {{Thickness[0.005],RGBColor[1,0,0]}}]

plot2=Plot[Evaluate[Table[-(Sqrt[x+C]),{C,-3,3}]],{x,-3,5},PlotStyle-> {{Thickness[0.005],RGBColor[1,0,0]}}]

Show[plot1,plot2,PlotRange->{-3,3}]

plot3=Plot[Evaluate[Table[C Exp[-2x],{C,-6,6}]],{x,-3,5},PlotStyle-> {{Thickness[0.005],RGBColor[0,0,1]}},PlotRange->{-3,3}]

Show[plot1,plot2,plot3,PlotRange->{-3,3}]