0% found this document useful (0 votes)
232 views

Practical-3 Plotting of Third Order Solution Family of Differential Equation

The document provides solutions to four questions involving plotting solutions to third order differential equations. For each question, the differential equation is given and DSolve is used to find general solutions. Specific solutions are then defined by assigning values to the constants and plotted over a given range.

Uploaded by

Aashna Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
232 views

Practical-3 Plotting of Third Order Solution Family of Differential Equation

The document provides solutions to four questions involving plotting solutions to third order differential equations. For each question, the differential equation is given and DSolve is used to find general solutions. Specific solutions are then defined by assigning values to the constants and plotted over a given range.

Uploaded by

Aashna Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Practical-3

Plotting of third order solution family


of differential equation.
Question 1: Solve third order differential equation (d^3 y)/dx^3-5 (d^2 y)/dx^2+8
dy/dx-4y=0 and plot its any three solutions.

Solution:
2

Needs ["PlotLegends` "]


sol = DSolve [y ''' [x] - 5 y '' [x] + 8 y '[x] - 4 y[x] ⩵ 0, y[x], x]
sol1 = Evaluate [ y[x] / . sol 〚 1〛 / . {C[1] → 1, C[2] → 0.5, C[3] → 2 / 3}]
sol2 = y[x] / . sol 〚 1〛 / . {C[1] → - 1 / 2, C[2] → 0, C[3] → 1}
sol3 = y[x] / . sol 〚 1〛 / . {C[1] → - 1, C[2] → - 4, C[3] → 2}
Plot [{sol1, sol2, sol3 }, {x, - 5, 3}, PlotRange → {- 30, 30 },
PlotStyle → {{Red, Thickness [0.01 ]}, {Green , Thick }, {Purple , Thickness [0.02 ]}},
PlotLegend → {sol1, sol2, sol3 }]
General : PlotLegends` is now obsolete . The legacy version being loaded may conflict with current functionality . See
the Compatibility Guide for updating information .

y[x] → ⅇ  1 + ⅇ 2 + ⅇ x  3 
x 2x 2x
Out[2]=

2
ⅇ + 0.5 ⅇ ⅇ
x 2x 2x
Out[3]= + x
3
ⅇx
+ⅇ
2x
Out[4]= - x
2

-ⅇ - 4 ⅇ +2ⅇ
x 2x 2x
Out[5]= x
30

20

10

-4 -2 2
Out[6]=
2
ⅇ x + ⅇ + 0.5
2x x
-10
3

ⅇx
-20

2x
x-
2
-30
2ⅇ x-ⅇ -4ⅇ
2x x 2x

Question 2: Solve third order differential equation (d^3


y)/dx^3+3 (d^2 y)/dx^2-25 dy/dx+21y=0 and plot its any four
solutions.

Solution:
3

eqn = y ''' [x] + 3 * y '' [x] - 25 * y '[x] + 21 * y[x];


sol = DSolve [eqn ⩵ 0, y[x], x]
sol1 = Evaluate [y[x] / . sol 〚 1〛 / . {C[1] → 1, C[2] → 0, C[3] → 2}]
sol2 = y[x] / . sol 〚 1〛 / . {C[1] → - 1 / 2, C[2] → 0, C[3] → 1}
sol3 = y[x] / . sol 〚 1〛 / . {C[1] → - 1, C[2] → - 4, C[3] → 2}
sol4 = y[x] / . sol 〚 1〛 / . {C[1] → - 0.5, C[2] → - 2, C[3] → 1}
Plot [{sol1, sol2, sol3, sol4 }, {x, - 0.5, 0.5 },
PlotStyle → {{Red, Thickness [0.01 ]}, {Green , Thick }, {Purple , Thickness [0.02 ]},
{ Orange , Thickness [0.01 ]}} , PlotLegend → { sol1, sol2, sol3, sol4 }]

y[x] → ⅇ 1 + ⅇ 2 + ⅇ  3 
-7 x x 3x
Out[8]=

ⅇ +2ⅇ
-7 x 3x
Out[9]=

1
ⅇ +ⅇ
-7 x 3x
Out[10]= -
2

-ⅇ -4ⅇ +2ⅇ
-7 x x 3x
Out[11]=

- 0.5 ⅇ -2ⅇ +ⅇ
-7 x x 3x
Out[12]=

20

10

-0.4 -0.2 0.2 0.4


ⅇ +2ⅇ
Out[13]= -7 x 3x

1 -10
ⅇ ⅇ
3x -7 x
-
2

-4ⅇ +
-7 x x
-ⅇ
-20

-0.5 ⅇ -2ⅇ
-7 x

Question 3: Solve third order differential equation (d^3


y)/dx^3-4 (d^2 y)/dx^2-25 dy/dx+28y=0 and plot its any four
solutions.

Solution:
4

eqn = y ''' [x] - 4 * y '' [x] - 25 * y '[x] + 28 * y[x]


sol = DSolve [eqn ⩵ 0, y[x], x]
sol1 = Evaluate [y[x] / . sol 〚 1〛 / . {C[1] → 1, C[2] → 0, C[3] → 2}]
sol2 = y[x] / . sol 〚 1〛 / . {C[1] → - 2, C[2] → 10, C[3] → 3}
sol3 = y[x] / . sol 〚 1〛 / . {C[1] → - 1, C[2] → - 4, C[3] → 20 }
sol4 = y[x] / . sol 〚 1〛 / . {C[1] → - 0.5, C[2] → - 2, C[3] → 1}
Plot [{sol1, sol2, sol3, sol4 }, {x, - 0.5, 0.5 },
PlotStyle → {{Red, Thickness [0.01 ]}, {Green , Thick }, {Purple , Thickness [0.02 ]},
{ Orange , Thickness [0.01 ]}} , PlotLegend → { sol1, sol2, sol3, sol4 }]

Out[14]= 28 y[x] - 25 y′ [x] - 4 y′′ [x] + y3  [x]

y[x] → ⅇ 1 + ⅇ 2 + ⅇ  3 
-4 x x 7x
Out[15]=

ⅇ +2ⅇ
-4 x 7x
Out[16]=

-2 ⅇ + 10 ⅇ + 3 ⅇ
-4 x x 7x
Out[17]=

-ⅇ - 4 ⅇ + 20 ⅇ
-4 x x 7x
Out[18]=

- 0.5 ⅇ -2ⅇ +ⅇ
-4 x x 7x
Out[19]=

80

60

40

ⅇ +2ⅇ
Out[20]= -4 x 7x

20
-2 ⅇ + 10 ⅇ
-4 x

4ⅇ +
-0.4 -0.2
-4 x x 0.2 0.4
-ⅇ -

-0.5 ⅇ -2ⅇ
-4 x

Question 4: Solve third order differential equation (d^3


y)/dx^3-13 (d^2 y)/dx^2+19 dy/dx+33y=cos(2x) and plot its
any four solutions.

Solution:
5

eqn = y ''' [x] - 13 * y '' [x] + 19 * y '[x] + 33 * y[x] - Cos [2 x]


sol = DSolve [eqn ⩵ 0, y[x], x]
sol1 = Evaluate [y[x] / . sol 〚 1〛 / . {C[1] → 1, C[2] → 0, C[3] → 2}]
sol2 = y[x] / . sol 〚 1〛 / . {C[1] → 10, C[2] → 3, C[3] → 6}
sol3 = y[x] / . sol 〚 1〛 / . {C[1] → - 1, C[2] → - 7, C[3] → 0.7 }
sol4 = y[x] / . sol 〚 1〛 / . {C[1] → - 10.5, C[2] → 2, C[3] → 1}
Plot [{sol1, sol2, sol3, sol4 }, {x, 4, 6},
PlotStyle → {{Red, Thickness [0.01 ]}, {Green , Thick }, {Purple , Thickness [0.02 ]},
{ Orange , Thickness [0.01 ]}} , PlotLegend → { sol1, sol2, sol3, sol4 }]
′ ′′ 3
Out[21]= - Cos [2 x] + 33 y[x] + 19 y [x] - 13 y [x] + y [x]

17 Cos [2 x] + 6 Sin [2 x]
 y[x] → ⅇ 1 + ⅇ 2 + ⅇ 3 + 
-x 3x 11 x
Out[22]=
1625
17 Cos [2 x] + 6 Sin [2 x]
ⅇ +2ⅇ
-x 11 x
Out[23]= +
1625
17 Cos [2 x] + 6 Sin [2 x]
Out[24]= 10 ⅇ - x + 3 ⅇ 3 x + 6 ⅇ 11 x +
1625
17 Cos [2 x] + 6 Sin [2 x]
-ⅇ -7ⅇ + 0.7 ⅇ
-x 3x 11 x
Out[25]= +
1625
17 Cos [2 x] + 6 Sin [2 x]
- 10.5 ⅇ +2ⅇ +ⅇ
-x 3x 11 x
Out[26]= +
1625

27
4 × 10

27
3 × 10

27
2 × 10
ⅇ +2ⅇ
-x 11 x
Out[27]= +

27
ⅇ +3ⅇ
× 10
110 -x 3x

-7ⅇ
-x 3x
-ⅇ +
4.5 5.0 5.5 6.0

-10.5 ⅇ +2ⅇ
-x

Question 5: Solve third order differential equation x^3(d^3


y)/dx^3+3x^2 (d^2 y)/dx^2+xdy/dx+y=0 and plot its any four
solutions.

Solution:
6

In[25]:= sol = DSolve [(x ^ 3) * y ''' [x] + (3 x ^ 2) * y '' [x] + x * y '[x] + y[x] ⩵ 0, y[x], x]
sol1 = Evaluate [ y[x] / . sol 〚 1〛 / . {C[1] → 1, C[2] → 0.5, C[3] → 2 / 3}]
sol2 = y[x] / . sol 〚 1〛 / . {C[1] → - 1 / 2, C[2] → 0, C[3] → 1}
sol3 = y[x] / . sol 〚 1〛 / . {C[1] → - 1, C[2] → - 4, C[3] → 2}
Plot [{sol1, sol2, sol3 }, {x, - 5, 3}, PlotRange → {- 30, 30 },
PlotStyle → {{Red, Thickness [0.01 ]}, {Green , Thick }, {Purple , Thickness [0.02 ]}},
PlotLegends → {sol1, sol2, sol3 }]
1 1 1
Out[25]=  y[x] → + x  3 Cos  3 Log [x] + x  2 Sin  3 Log [x]
x 2 2
1 2 1 1
Out[26]= + x Cos  3 Log [x] + 0.5 x Sin  3 Log [x]
x 3 2 2
1 1
Out[27]= - + x Cos  3 Log [x]
2x 2
1 1 1
Out[28]= - +2 x Cos  3 Log [x] - 4 x Sin  3 Log [x]
x 2 2
30

20

1 1 2
10 + 0.5 x sin 3 log(x) + x cos
x 2 3

1 1
Out[29]= x cos 3 log(x) -
0.5 1.0 1.5 2.0 2.5 3.0 2 2x

1 1
-10 - -4 x sin 3 log(x) + 2 x cos
x 2

-20

-30

Question 6 :
Solve third order differential equation x ^ 3
(d ^ 3 y) / dx ^ 3 - 4 x ^ 2 (d ^ 2 y) / dx ^ 2 + 8 x dy / dx - 8 y
4 logx and plot its any four solutions.

Solution :
7

In[30]:= sol = DSolve [(x ^ 3) * y ''' [x] + (- 4 x ^ 2) * y '' [x] + 8 x * y '[x] - 8 y[x] ⩵ 4 Log [x], y[x], x]
sol1 = Evaluate [ y[x] / . sol 〚 1〛 / . {C[1] → 1, C[2] → 0.5, C[3] → 2 / 3}]
sol2 = y[x] / . sol 〚 1〛 / . {C[1] → - 1 / 2, C[2] → 0, C[3] → 1}
sol3 = y[x] / . sol 〚 1〛 / . {C[1] → - 1, C[2] → - 4, C[3] → 2}
Plot [{sol1, sol2, sol3 }, {x, - 5, 3}, PlotRange → {- 30, 30 },
PlotStyle → {{Red, Thickness [0.01 ]}, {Green , Thick }, {Purple , Thickness [0.02 ]}},
PlotLegends → {sol1, sol2, sol3 }]
1
 y[x] → x  1 + x  2 + x  3 +
2 4
Out[30]= × (- 7 - 4 Log [x])
8

2 x4 1
Out[31]= x + 0.5 x2 + + × (- 7 - 4 Log [x])
3 8
x 4
1
Out[32]= - +x + × (- 7 - 4 Log [x])
2 8

2 4
1
Out[33]= -x - 4 x + 2 x + × (- 7 - 4 Log [x])
8
30

20

2 x4 1
10 + 0.5 x 2 + x + × (-4 log(x) - 7)
3 8

x 1
Out[34]= x4 - + × (-4 log(x) - 7)
0.5 1.0 1.5 2.0 2.5 3.0 2 8

1
-10 2 x4 - 4 x2 - x + × (-4 log(x) - 7)
8

-20

-30

You might also like