Lösungen

1 Schwingungen

a

Remove["Global`*"];
gleichung[m_,d_,f_,funktion_]:={m*y''[x]+ d*y'[x]+ f*y[x] == funktion, y[0]==1, y'[0]==0};
m=1; d=0; f=1; funktion=0;
solv = 
DSolve[gleichung[m,d,f,funktion],y,x];
y = y/.solv[[1]];
Print["m = ",m,"  d = ",d,"  f = ",f,"  funktion = ",funktion];
Print["==>  y[x] = ",y[x]//Simplify];
Plot[y[x],{x,0,4Pi}];

b

Remove["Global`*"];
(* Neues f = 1/2 * altes f  *)
gleichung[m_,d_,f_,funktion_]:={m*y''[x]+ d*y'[x]+ f*y[x] == funktion, y[0]==1, y'[0]==0};
m=1; d=0; f=1/2; funktion=0;
solv = 
DSolve[gleichung[m,d,f,funktion],y,x];
y = y/.solv[[1]];
Print["m = ",m,"  d = ",d,"  f = ",f,"  funktion = ",funktion];
Print["==>  y[x] = ",y[x]//Simplify];
Plot[y[x],{x,0,4Pi}];

c

Remove["Global`*"];
gleichung[m_,d_,f_,funktion_]:={m*y''[x]+ d*y'[x]+ f*y[x] == funktion, y[0]==1, y'[0]==0};
m=2; d=0; f=1; funktion=0;
solv = 
DSolve[gleichung[m,d,f,funktion],y,x];
y = y/.solv[[1]];
Print["m = ",m,"  d = ",d,"  f = ",f,"  funktion = ",funktion];
Print["==>  y[x] = ",y[x]//Simplify];
Plot[y[x],{x,0,4Pi}];

d

Remove["Global`*"];
gleichung[m_,d_,f_,funktion_]:={m*y''[x]+ d*y'[x]+ f*y[x] == funktion, y[0]==1, y'[0]==0};
m=1; d=0; f=1; funktion=10;
solv = 
DSolve[gleichung[m,d,f,funktion],y,x];
y = y/.solv[[1]];
Print["m = ",m,"  d = ",d,"  f = ",f,"  funktion = ",funktion];
Print["==>  y[x] = ",y[x]//Simplify];
Plot[y[x],{x,0,4Pi}];

e

Remove["Global`*"];
gleichung[m_,d_,f_,funktion_]:={m*y''[x]+ d*y'[x]+ f*y[x] - f*(-y[x])== funktion, y[0]==1, y'[0]==0};
m=1; d=0; f=1; funktion=0;
solv = 
DSolve[gleichung[m,d,f,funktion],y,x];
y = y/.solv[[1]];
Print["m = ",m,"  d = ",d,"  f = ",f,"  funktion = ",funktion];
Print["==>  y[x] = ",y[x]//Simplify];
Plot[y[x],{x,0,4Pi}];

f

Remove["Global`*"];

links1 = 1*y1''[x] +  1*y1[x] - 1*(y2[x]-y1[x]);
links2 = 1*y2''[x] +  1*y2[x] - 1*(y1[x]-y2[x]);
{links1 + links2 == 0+0, links1 - links2 == 0+0}

Sei  r[x_] := y1[x] + y2[x],  s[x_] := y1[x] - y2[x]

links1 + links2

u1 = links1 + links2 /. {y1[x]+y2[x] -> r[x]} /.{y1''[x]+y2''[x] -> r''[x]}

links1 - links2

u2 = links1 - links2

u2 = links1 - links2 /. {3 y1[x]- 3 y2[x] -> 3 s[x]} /.{y1''[x]-y2''[x] -> s''[x]}

Das ergibt die Differentialgleichungen:
r[x] + r''[x] = 0,  r[x] = y1[x] + y2[x],  r[0] = 6,  r'[0] = 0  und
s[x] + s''[x] = 0,  s[x] = y1[x] - y2[x],  s[0] = -4,  s'[0] = 0
Diese Gleichungen sind unabhängig lösbar.

Remove[m,d,f,funktion,r,s,x];
gleichung[m_,d_,f_,funktion_]:={m*r''[x]+ d*r'[x]+ f*r[x] == funktion, r[0]==3, r'[0]==0};
m=1; d=0; f=1; funktion=0;
solv = 
DSolve[gleichung[m,d,f,funktion],r,x];
r = r/.solv[[1]];
Print["m = ",m,"  d = ",d,"  f = ",f,"  funktion = ",funktion];
Print["==>  r[x] = ",r[x]//Simplify];
Plot[r[x],{x,0,4Pi}];

Remove[m,d,f,funktion,s,x];
gleichung[m_,d_,f_,funktion_]:={m*s''[x]+ d*s'[x]+ f*s[x] == funktion, s[0]==1, s'[0]==0};
m=1; d=0; f=3; funktion=0;
solv = 
DSolve[gleichung[m,d,f,funktion],s,x];
s = s/.solv[[1]];
Print["m = ",m,"  d = ",d,"  f = ",f,"  funktion = ",funktion];
Print["==>  s[x] = ",s[x]//Simplify];
Plot[s[x],{x,0,4Pi}];

y1[x_]:= (r[x]+s[x])/2;
y2[x_]:= (r[x]-s[x])/2 -6; (* Koordinatenverschiebung -6 *)
Print["==>  y1[x] = ",y1[x]//Simplify];
Plot[y1[x],{x,0,4Pi}];
Print["==>  y2[x] = ",y2[x]-6//Simplify];
Plot[y2[x],{x,0,4Pi}];
Plot[{y1[x],y2[x],-6},{x,0,4Pi}];

Plot[{y1[x],y2[x],-6},{x,0,12Pi}];

g

Remove["Global`*"];
gleichung[m_,d_,f_,funktion_]:={m*y''[x]+ d*y'[x]+ f*y[x] == funktion, y[0]==1, y'[0]==0};
m=1; d=0; f=1; funktion=Sin[x];
solv = 
DSolve[gleichung[m,d,f,funktion],y,x];
y = y/.solv[[1]];
Print["m = ",m,"  d = ",d,"  f = ",f,"  funktion = ",funktion];
Print["==>  y[x] = ",y[x]//Simplify];
Plot[y[x],{x,0,4Pi}];

Plot[y[x],{x,0,20Pi}];

h

Remove["Global`*"];
gleichung[m_,d_,f_,funktion_]:={m*y''[x]+ d*y'[x]+ f*y[x] == funktion, y[0]==1, y'[0]==0};
m=1; d=1; f=1; funktion= 0;
solv = 
DSolve[gleichung[m,d,f,funktion],y,x];
y = y/.solv[[1]];
Print["m = ",m,"  d = ",d,"  f = ",f,"  funktion = ",funktion];
Print["==>  y[x] = ",y[x]//Simplify];
Plot[y[x],{x,0,4Pi}];

i

Remove["Global`*"];
gleichung[m_,d_,f_,funktion_]:={m*y''[x]+ d*y'[x]+ f*y[x] == funktion, y[0]==1, y'[0]==0};
m=1; d=1; f=1; funktion= Sin[x];
solv = 
DSolve[gleichung[m,d,f,funktion],y,x];
y = y/.solv[[1]];
Print["m = ",m,"  d = ",d,"  f = ",f,"  funktion = ",funktion];
Print["==>  y[x] = ",y[x]//Simplify];
Plot[y[x],{x,0,4Pi}];

Plot[y[x],{x,0,12Pi}];

j

Remove["Global`*"];
f1 = 3; f2 = 4;
geichungen= {F == f x, F == a x1, F == b x2, x == x1+x2};
solv = Solve[geichungen, {f,x1,x2,x,F}]

solv[[2]][[1]]

solv1=solv[[2]][[1]] /. {a->3, b->4}

f = f /. solv1

gleichung[m_,d_,f_,funktion_]:={m*y''[x]+ d*y'[x]+ f*y[x] == funktion, y[0]==0, y'[0]==1};
m=2; d=1; f=f; funktion= 4 Sin[2 x];
solv = 
DSolve[gleichung[m,d,f,funktion],y,x];
y = y/.solv[[1]];
Print["m = ",m,"  d = ",d,"  f = ",f,"  funktion = ",funktion];
Print["==>  y[x] = ",y[x]//Simplify];
Plot[y[x],{x,0,4Pi}];

Plot[y[x],{x,0,12Pi}];

2 Linienintegrale

a

i

Remove["Global`*"];
F[x_,y_,z_]:= {3 x y, 5 z, 10 x};
v[t]:= {t^2+1,2 t^2,t^3};
D[v[t],t]

integrand[t_]:= F[x,y,z].Evaluate[D[v[t],t]] /.{x->v[t][[1]], y->v[t][[2]], z->v[t][[3]]};
integrand[t]

integrand[t]/.t->u

Integrate[Evaluate[integrand[t]/.t->u],{u,0,2}]

ii

Remove["Global`*"];
F[x_,y_,z_]:= {3 x y, 5 z, 10 x};
absF[x_,y_,z_]:= Sqrt[F[x,y,z].F[x,y,z]];
absF[x,y,z]

v[t] := {t^2 + 1, 2 t^2, t^3};
Sqrt[D[v[t], t] . D[v[t], t]]

integrand[t_]:= absF[x,y,z]* Evaluate[Sqrt[D[v[t],t].D[v[t],t]]] /.{x->v[t][[1]], y->v[t][[2]], z->v[t][[3]]};
integrand[t]

integrand[t]/.t->u

Integrate[Evaluate[integrand[t]/.t->u],{u,0,2}]

NIntegrate[Evaluate[integrand[t]/.t->u],{u,0,2}]

b

i

Remove["Global`*"];
F[x_,y_,z_]:= {3 x y, 5 z, 10 x};
v[t]:= {t^3,2 t^2,t^2+1};
D[v[t],t]

integrand[t_]:= F[x,y,z].Evaluate[D[v[t],t]] /.{x->v[t][[1]], y->v[t][[2]], z->v[t][[3]]};
integrand[t]

integrand[t]/.t->u

Integrate[Evaluate[integrand[t]/.t->u],{u,0,2}]

ii

Remove["Global`*"];
F[x_,y_,z_]:= {3 x y, 5 z, 10 x};
absF[x_,y_,z_]:= Sqrt[F[x,y,z].F[x,y,z]];
absF[x,y,z]

v[t] := {t^3, 2 t^2, t^2 + 1};
Sqrt[D[v[t], t] . D[v[t], t]]

integrand[t_]:= absF[x,y,z]* Evaluate[Sqrt[D[v[t],t].D[v[t],t]]] /.{x->v[t][[1]], y->v[t][[2]], z->v[t][[3]]};
integrand[t]

integrand[t]/.t->u

Integrate[Evaluate[integrand[t]/.t->u],{u,0,2}]

NIntegrate[Evaluate[integrand[t]/.t->u],{u,0,2}]

c

i

Remove["Global`*"];
F[x_,y_,z_]:= {3 x y, 5 z, 10 x};
v[t]:={Cos[t],Sin[2 t],1+Sin[3 t]};
D[v[t],t]

integrand[t_]:= F[x,y,z].Evaluate[D[v[t],t]] /.{x->v[t][[1]], y->v[t][[2]], z->v[t][[3]]};
integrand[t]

integrand[t]/.t->u

(* Integrate[Evaluate[integrand[t]/.t->u],{u,0,2Pi}] *)

NIntegrate[Evaluate[integrand[t]/.t->u],{u,0,2Pi}]

ii

Remove["Global`*"];
F[x_,y_,z_]:= {3 x y, 5 z, 10 x};
absF[x_,y_,z_]:= Sqrt[F[x,y,z].F[x,y,z]];
absF[x,y,z]

v[t] := {Cos[t], Sin[2 t], 1 + Sin[3 t]};
Sqrt[D[v[t], t] . D[v[t], t]]

integrand[t_]:= absF[x,y,z]* Evaluate[Sqrt[D[v[t],t].D[v[t],t]]] /.{x->v[t][[1]], y->v[t][[2]], z->v[t][[3]]};
integrand[t]

integrand[t]/.t->u

(* Integrate[Evaluate[integrand[t]/.t->u],{u,0,2}] *)

NIntegrate[Evaluate[integrand[t]/.t->u],{u,0,2 Pi}]

3    Allgemeine Lösungen wichtiger Differentialgleichungen mit der Maschine

a)    y'(x) + α  y(x) = f(x)

Remove["Global`*"];
solv1 = 
        DSolve[ y'[x] + α  y[x] == f[x], y, 
          x];
u[x_] := y /. solv1[[1]];
a = (u[x][x]  // 
                      InputForm)[[1]][[2]][[2]][[2]][[1]];
v[x_] := u[x][x] /. a -> t;
Print["y(x) = ", v[x]];
Print["     = ", v[x] // Simplify];
v[w] // Simplify

b)    y''(x) + α y'(x) + β  y(x) = f(x)

Remove["Global`*"];
solv2 = DSolve[y''[
                  x] + α y'[x] + β y[x] == f[x], y, 
            x][[1]];
u[x_] := y /. solv2[[1]];
a = u[
                    x][[2]][[3]][[2]][[2]][[1]];
b = u[
                    x][[2]][[4]][[2]][[2]][[1]];
v[
          x_] := u[x][x] /. {a -> t, 
            b -> t};
Print["y(x) = ", v[x]];
Print["     = ", v[x] // Simplify];
v[w] // Simplify

c)  Wahl von Parametern  α = 2,  β = -1,  C[1] = 1,  C[2] = 1,  f(x) = cos(x),  Plot

Maschinenlösung

Remove["Global`*"];
solv2 = DSolve[y''[
                  x] + α y'[x] + β y[x] == f[x], y, 
            x][[1]];
u[x_] := y /. solv2[[1]];
a = u[
                    x][[2]][[3]][[2]][[2]][[1]];
b = u[
                    x][[2]][[4]][[2]][[2]][[1]];
v[
          x_] := u[x][x] /. {a -> t, 
            b -> t};
s[u_] := 
        v[x]  /.  {x -> u,  α -> 
              2, β -> -1,  C[1] -> 1,  C[2] -> 1, 
            f[t] -> Cos[t]};
Print["y(x) = ",    s[x] // N // 
          Simplify];
Print["y(0) = ",    s[0] // N];
Print["y'(0) = ",   (D[s[m], m] /. m -> 0) // 
          N];
Plot[s[m], {m, 0, Pi}, AspectRatio -> 1];

Direkter Plot der exakten Lösung mit Ausgabe der Funktion

Remove["Global`*"];
solv = Flatten[DSolve[{y''[x]+2 y'[x]-1 y[x]==Cos[x],y[0]==2.86909,y'[0]==-4.80015},y,x]];
y = y/.solv;
Print["y(x) = ",Simplify[y[x]]];
Print["y(0) = ", y[0], " y'(0) = ",(D[y[x],x] /. x->0) //N];
Plot[y[x],{x,0,Pi},AspectRatio->1];
Plot[y[x],{x,0,4 Pi},AspectRatio->1];

Direkter Plot der numerischen Lösung

Remove["Global`*"];
solution=NDSolve[{y''[x]+2 y'[x]-1 y[x]==Cos[x],y[0]==2.86909,y'[0]==-4.80015},y,{x,0,4 Pi}];
Plot[y[x]/. solution,{x,0,Pi},AspectRatio->1];
Plot[y[x]/. solution,{x,0,4 Pi},AspectRatio->1];

d)  Direkter Plot der exakten Lösung einer anderen D'Gl.

Maschinenlösung

Remove["Global`*"];
solv = Flatten[DSolve[{y''[x] + y'[x] - y[x] ==Cos[x+1], y[0]==1, y'[0]==0},y,x]];
y = y/.solv;
Print["y(x) = ",Simplify[y[x]]];
Print["Numerisch y(x) = ",Simplify[y[x]]//N];
Plot[y[x],{x,0,Pi},AspectRatio->1];

p1=Plot[y[x],{x,0,Pi},AspectRatio->1];

Handlösung

solv=Solve[λ^2+λ-1==0,{λ}][[1]];
loes1=λ /. solv;
loes1//TeXForm

solv=Solve[λ^2+λ-1==0,{λ}][[2]];
loes2=λ /. solv;
loes2//TeXForm

Remove[x,y,c1,c2]
solv = Flatten[DSolve[y''[x] + y'[x] - y[x]==0,y,x]];
y = y/.solv;
y[x]

Cos[x+1]//TrigExpand

solv3=Flatten[Simplify[Solve[{-2 r+s==Cos[1], -r-2s==-Sin[1]},{r,s}]]]

r=r /.solv3[[1]]; s=s /.solv3[[2]]

Remove[y];
y[x_,c1_,c2_]:= c1 E^(1/2(-1-Sqrt[5])x)+c2 E^(1/2(-1+Sqrt[5])x)+ r  Cos[x]+ s Sin[x];
y[x,c1,c2]//Simplify

y[x,c1,c2]

D[y[x,c1,c2],x]//Simplify

y[0,c1,c2]

(Simplify[D[y[x,c1,c2],x]]/.x->0)

solv=Flatten[Solve[Evaluate[{y[0,c1,c2]==1, (D[y[x,c1,c2],x]/.x->0)==0}],{c1,c2} ]]

c1=c1/.solv[[1]]//Simplify

c2=c2/.solv[[2]]//Simplify

y[x,c1,c2]

y[x,c1,c2]//Simplify

y[x,c1,c2]//N//Simplify

p2 = Plot[y[x,c1,c2],{x,0,Pi},AspectRatio->1];

Show[p1,p2];

Remove[x,y];
solv = Flatten[DSolve[{y''[x] + y'[x] - y[x] ==Cos[x+1], y[0]==1, y'[0]==0},y,x]];
y = y/.solv;
Print["y(x) = ",Simplify[y[x]]];
Print["Numerisch y(x) = ",Simplify[y[x]]//N];
Plot[y[x],{x,0,Pi},AspectRatio->1];

y[x]//Simplify//N