Practical-6: Method of Variation of Parameter

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

PRACTICAL-6

Method of Variation of Parameter


Question 1: Solve second order differential equation
d2 y
+y = tanx by method of variation of parameter.
dx2

Solution: Step-1 find complementary function

eqn := y ''[x] + y[x];


f[x_] := Tan[x];
P = DSolve [eqn  0, y[x], x]
{{y[x]  C[1] Cos[x] + C[2] Sin[x]}}

Step-2 Consider fundamental solution function u(x) and v(x)


u[x_] := Cos [x];
v[x_] := Sin[x];

u v
Step-3 Find Wronskian W =
u' v '
u[x] v[x]
W = Simplify Det 
u '[x] v '[x]
1

-v [ x ]×f [ x ] u[ x ]×f [ x ]
Step-4 Find g(x) = W
and h(x) = W

- v[x] × f[x]
g[x_] :=
W
u[x] × f[x]
h[x_] :=
W

Step-5 Find G = ∫ g  x and H=∫ h  x

G = Integrate[g[x], x]
H = Simplify[Integrate[h[x], x]]
x x x x
LogCos  - Sin  - LogCos  + Sin  + Sin[x]
2 2 2 2
- Cos[x]

Step-6 Find PI = uG + vH
2 NIDHI P6.nb

PI = U[X] G + v[x] H
x x x x
- Cos[x] Sin[x] + LogCos  - Sin  - LogCos  + Sin  + Sin[x] U[X]
2 2 2 2

ClearAll
ClearAll

d2 y 2 dy
Question 2: Solve second order differential equation - = ex sinx by method of variation
dx2 dx
of parameter.
Solution: Step-1 find complementary function

eqn := y ''[x] - 2 y '[x];


f[x_] := x Sin[x];
P = DSolve [eqn  0, y[x], x]
1
y[x]  2 x C[1] + C[2]
2

Step-2 Consider fundamental solution function u(x) and v(x)


1
u[x_] := 2 x ;
2
v[x_] := 1;

u v
Step-3 Find Wronskian W =
u' v '

u[x] v[x]
W = SimplifyDet 
u '[x] v '[x]
- 2 x

-v [ x ]×f [ x ] u[ x ]×f [ x ]
Step-4 Find g(x) = W
and h(x) = W

- v[x] × f[x]
g[x_] :=
W
u[x] × f[x]
h[x_] :=
W

Step-5 Find G = ∫ g  x and H=∫ h  x

G = Integrate[g[x], x]
H = Simplify[Integrate[h[x], x]]
1
- -x (Cos[x] + Sin[x])
2
1
x (Cos[x] - Sin[x])
4

Step-6 Find PI = uG + vH
NIDHI P6.nb 3

PI = u[x] G + v[x] H
1 1
x (Cos[x] - Sin[x]) - x (Cos[x] + Sin[x])
4 4

You might also like