We solve a second order differential equation of the type:
ay''+by'+cy=f(x)
where a=1
b=3
c=2
f(x)=1/(1+e^x)
The solution will consist of common and particular solutions and have a type:
ygen =ycom +ypart
To find a common solution we solve second order differential equation y''+3y'+2y=0 and find roots of polynomial r2 +3r+2=0
Its roots
r 1 = − 3 + 3 2 − 4 ⋅ 1 ⋅ 2 2 ⋅ 1 = − 3 + 1 2 = − 3 + 1 2 = − 1 r_1={{-3+\sqrt{3^2-4\sdot1\sdot2}}\over{2\sdot1}}={{{-3+\sqrt{1}}\over{2}}={{-3+1}\over{2}}}={-1} r 1 = 2 ⋅ 1 − 3 + 3 2 − 4 ⋅ 1 ⋅ 2 = 2 − 3 + 1 = 2 − 3 + 1 = − 1
r 2 = − 3 − 3 2 − 4 ⋅ 1 ⋅ 2 2 ⋅ 1 = − 3 − 1 2 = − 3 − 1 2 = − 2 r_2={{-3-\sqrt{3^2-4\sdot1\sdot2}}\over{2\sdot1}}={{{-3-\sqrt{1}}\over{2}}={{-3-1}\over{2}}}={-2} r 2 = 2 ⋅ 1 − 3 − 3 2 − 4 ⋅ 1 ⋅ 2 = 2 − 3 − 1 = 2 − 3 − 1 = − 2
Roots are complex therefore the common solution will be y c o m = C 1 e − x + C 2 e − 2 x y_{com}=C_1e^{-{x}}+C_2e^{-2{x}} y co m = C 1 e − x + C 2 e − 2 x
We will use the method of variation of parameters to find a particular solution
{ C 1 ′ ( x ) y 1 + C 2 ′ ( x ) y 2 = 0 C 1 ′ ( x ) y 1 ′ + C 2 ′ ( x ) y 2 ′ = f ( x ) a 0 \begin{cases}
C'_1(x)y_1+C'_2(x)y_2=0 \\
C'_1(x)y'_1+C'_2(x)y'_2={f(x)\over {a_0}}
\end{cases} { C 1 ′ ( x ) y 1 + C 2 ′ ( x ) y 2 = 0 C 1 ′ ( x ) y 1 ′ + C 2 ′ ( x ) y 2 ′ = a 0 f ( x )
y 1 = e − x y 2 = e − 2 x a 0 = 1 y_1=e^{-{x}}\\
y_2=e^{-{2x}}\\
a_0=1 y 1 = e − x y 2 = e − 2 x a 0 = 1
finally we get
{ C 1 ′ ( x ) e − x + C 2 ′ ( x ) e − 2 x = 0 ( 1 ) − C 1 ′ ( x ) e − x − 2 C 2 ′ ( x ) e − 2 x = 1 1 + e x ( 2 ) \begin{cases}
C'_1(x)e^{-{x}}+C'_2(x)e^{-{2x}}=0 (1)\\
-C'_1(x)e^{-{x}}-2C'_2(x)e^{-{2x}}={1\over {1+e^{{x}}}} (2)
\end{cases} { C 1 ′ ( x ) e − x + C 2 ′ ( x ) e − 2 x = 0 ( 1 ) − C 1 ′ ( x ) e − x − 2 C 2 ′ ( x ) e − 2 x = 1 + e x 1 ( 2 )
add (2) to (1) and we get
− 2 C 2 ′ ( x ) e − 2 x = 1 1 + e x C 2 ′ ( x ) = − e 2 x 1 + e x -2C'_2(x)e^{-{2x}}={1\over {1+e^{x}}}\\
C'_2(x)=-{e^{2x}\over {1+e^{x}}} − 2 C 2 ′ ( x ) e − 2 x = 1 + e x 1 C 2 ′ ( x ) = − 1 + e x e 2 x
We will make some changes and simplifications
C 2 ′ ( x ) = − e 2 x + e x − e x 1 + e x = − e x ( e x + 1 ) e x + 1 + e x e x + 1 = − e x + e x e x + 1 C'_2(x)=-{e^{2x}+e^{x}-e^{x}\over {1+e^{x}}}=-{e^{x}(e^{x}+1)\over {e^{x}+1}}+{e^{x}\over {e^{x}+1}}=-e^{x}+{e^{x}\over {e^{x}+1}} C 2 ′ ( x ) = − 1 + e x e 2 x + e x − e x = − e x + 1 e x ( e x + 1 ) + e x + 1 e x = − e x + e x + 1 e x
Let us integrate C'2
C 2 ( x ) = ⎰ ( − e x + e x e x + 1 ) d x = − e x + l n ∣ e x + 1 ∣ + C 2 C_2(x)=\lmoustache{(-e^{x}+{e^{x}\over {e^{x}+1}})dx}=-e^{x}+ln\vert{{e^{x}+1}}\vert+C_2 C 2 ( x ) = ⎰ ( − e x + e x + 1 e x ) d x = − e x + l n ∣ e x + 1 ∣ + C 2
we multiply (1) by 2, add to (2) and get
C 1 ′ ( x ) e − x = 1 1 + e x C 1 ′ ( x ) = e x 1 + e x C'_1(x)e^{-{x}}={1\over {1+e^{x}}}\\
C'_1(x)={e^{x}\over {1+e^{x}}} C 1 ′ ( x ) e − x = 1 + e x 1 C 1 ′ ( x ) = 1 + e x e x
Let us integrate C'1
C 1 ( x ) = ⎰ ( e x e x + 1 ) d x = l n ∣ e x + 1 ∣ + C 1 C_1(x)=\lmoustache{({e^{x}\over {e^{x}+1}})dx}=ln\vert{{e^{x}+1}}\vert+C_1 C 1 ( x ) = ⎰ ( e x + 1 e x ) d x = l n ∣ e x + 1 ∣ + C 1
Now we add these values in our general solution for y and will get
y g e n = ( − e x + l n ∣ e x + 1 ∣ + C 1 ) e − x + e − 2 x ( l n ∣ e x + 1 ∣ + C 2 ) y_{gen}=(-e^{x}+ln\vert{{e^{x}+1}}\vert+C_1)e^{-{x}}+e^{-{2x}}(ln\vert{{e^{x}+1}}\vert+C_2) y g e n = ( − e x + l n ∣ e x + 1 ∣ + C 1 ) e − x + e − 2 x ( l n ∣ e x + 1 ∣ + C 2 )
Finally we get
y g e n = 1 + e − x l n ∣ e x + 1 ∣ + C 1 e − x + e − 2 x l n ∣ e x + 1 ∣ + C 2 e − 2 x y_{gen}=1+e^{-{x}}ln\vert{{e^{x}+1}}\vert+C_1e^{-{x}}+e^{-{2x}}ln\vert{{e^{x}+1}}\vert+C_2e^{-{2x}} y g e n = 1 + e − x l n ∣ e x + 1 ∣ + C 1 e − x + e − 2 x l n ∣ e x + 1 ∣ + C 2 e − 2 x
Comments