Solution of 2nd order Differential Equations using the Wronskian
y’’+p(x).y’+q(x).y = r(x)
The general solution, y(x) is of the form
y = y_p + y_g
Where,
y_g = C1.y1 + C2.y2
Where y1 and y2 are solutions of the homogeneous D.E.
And,
y_p = -y1*int{(r(x).y2)/W(y1,y2)}dx + y2*int{(r(x).y1)/W(y1,y2)}dx
Where y_p is a particular solution of the inhomogeneous D.E. (solving with r(x).)
And,
W(y1,y2) = y1.(y2)’ – y2.(y1)’
Solving the homogeneous equation
If only one solution can be initially found, then a 2nd solution can be found using the Wronskian.
Let y = x, say be a given solution.
Then a 2nd solution, y2(x) is given by
y2 = y1*int{W/(y1)^2}dx
Where,
W = C*exp(-int(p)dx)
And, p = p(x) from y’’ + p(x).y’ + q(x).y = 0.
Our D.E.
We have,
y’’ – 2.y’ + 2.y = e^x.sec(x)
Homogeneous Solution
y’’ – 2.y’ + 2.y = 0
Auxiliary Eqn
m^2 – 2m + 2 = 0
(m^2 – 2m + 1) + 1 = 0
(m – 1)^2 = -1
m = 1 +/- i
The complementary solution is,
y_g = e^x(A.cos(x) + B.sin(x))
y_g = A.e^x.cos(x) + B.e^x.sin(x)
y_g = C1.y1 + C2.y2
We now have y1(x) = e^x.cos(x) and y2(x) = e^x.sin(x) as solutions to the homogeneous equation.
(We don't need to use the Wronskian here to get a 2nd solution as we already have 2 solutions)
Now with the formula,
y_p = -y1*int{(r(x).y2)/W(y1,y2)}dx + y2*int{(r(x).y1)/W(y1,y2)}dx
Wronskian,
W(y1,y2) = y1.(y2)’ – y2.(y1)’
W(y1,y2) = e^x.cos(x)*e^x(sin(x) + cos(x)) – e^x.sin(x)*e^x(cos(x) – sin(x))
W(y1,y2) = e^(2x).(cos(x).sin(x) + cos^2(x)) – e^(2x).(sin(x).cos(x) – sin^2(x))
W(y1,y2) = e^(2x)
With r(x) = e^x.sec(x),
y_p = -e^x.cos(x)*int{(e^x.sec(x).e^x.sin(x))/e^(2x)}dx + e^x.sin(x)*int{(e^x.sec(x).e^x.cos(x))/e^(2x)}dx
y_p = -e^x.cos(x)*int{sec(x).sin(x)}dx + e^x.sin(x)*int{sec(x).cos(x)}dx
y_p = -e^x.cos(x)*int{tan(x)}dx + e^x.sin(x)*int{1}dx
y_p = -e^x.cos(x)*(-ln(cos(x)) + e^x.sin(x)*x
y_p = e^x(x.sin(x) + cos(x).ln(cos(x)))
The General Solution is, y(x) = y_g + y_p.
Y(x) = A.e^x.cos(x) + B.e^x.sin(x) + e^x(x.sin(x) + cos(x).ln(cos(x)))