You are on page 1of 60

86505.

wxmx 1 / 60
86505.wxmx 2 / 60
86505.wxmx 3 / 60

1 - PRACTICAL 1 -> Solution of


First Order DE

2 - PRACTICAL 2 -> Plotting of


Second Order family of
Differential Equations

3 - PRACTICAL 3 -> Plotting of


third order family of
Differential Equation

4 - PRACTICAL 4 -> Solution of


Differential Equation by
Variation of Parameter method
5 - PRACTICAL 5 -> Solution of
system of ordinary Differential
Equations
6 - PRACTICAL 6 -> Solution of
Cauchy Problem of First Order
PDE
7 - PRACTICAL 7 -> Finding the
CharActeristics of First Order
PDE
86505.wxmx 4 / 60

8 - PRACTICAL 8 -> Plotting the


Integral Surface of first order
PDE with initial data

Ques.1 Solve the first order differential equation


y'=x^3-x^2-1 with y(0)=k , k=0,1,2,3
86505.wxmx 5 / 60

/*Answer-*/
eq:'diff(y,x)=x^3−x^2−1;
sol:ode2(eq,y,x);
sol1:ic1(sol,x=0,y=k);
ev(sol1,k=0); /*Solution 1 for k=0*/
ev(sol1,k=1); /*Solution 2 for k=1*/
ev(sol1,k=2); /*Solution 3 for k=2*/
ev(sol1,k=3); /*Solution 4 for k=3*/
d 3 2
y =x −x −1
dx
4 3
x x
y= − −x +%c
4 3
4 3
3 x − 4 x − 12 x + 12 k
y=
12
4 3
3 x − 4 x − 12 x
y=
12
4 3
3 x − 4 x − 12 x + 12
y=
12
4 3
3 x − 4 x − 12 x + 24
y=
12
4 3
3 x − 4 x − 12 x + 36
y=
12
Ques.2 Solve the first order differential equation
y'=x^4-x-1 with y(0)=k , k=4,5,6,7,
/*Answer-*/
eq:'diff(y,x)=x^4−x−1;
sol:ode2(eq,y,x);
sol1:ic1(sol,x=0,y=k);
ev(sol1,k=4); /*Solution 1 for k=4*/
ev(sol1,k=5); /*Solution 2 for k=5*/
ev(sol1,k=6); /*Solution 3 for k=6*/
ev(sol1,k=7); /*Solution 4 for k=7*/
d 4
y =x −x −1
dx
86505.wxmx 6 / 60

5 2
x x
y= − −x +%c
5 2
5 2
2 x − 5 x − 10 x + 10 k
y=
10
5 2
2 x − 5 x − 10 x + 40
y=
10
5 2
2 x − 5 x − 10 x + 50
y=
10
5 2
2 x − 5 x − 10 x + 60
y=
10
5 2
2 x − 5 x − 10 x + 70
y=
10
Ques.3 Solve the first order differential equation
y'=x^3-x-1 with y(0)=k , k=2,3,4,5
/*Answer-*/
eq:'diff(y,x)=x^3−x−1;
sol:ode2(eq,y,x);
sol1:ic1(sol,x=0,y=k);
ev(sol1,k=2); /*Solution 1 for k=2*/
ev(sol1,k=3); /*Solution 2 for k=3*/
ev(sol1,k=4); /*Solution 3 for k=4*/
ev(sol1,k=5); /*Solution 4 for k=5*/
d 3
y =x −x −1
dx
4 2
x x
y= − −x +%c
4 2
4 2
x −2 x −4 x+4 k
y=
4
4 2
x −2 x −4 x+8
y=
4
4 2
x − 2 x − 4 x + 12
y=
4
86505.wxmx 7 / 60

4 2
x − 2 x − 4 x + 16
y=
4
4 2
x − 2 x − 4 x + 20
y=
4
Ques.4 - Solve dy/dx= cos(x)y + exp(sin(x)) with IC
y(0)=3
/*Answer-*/
eq:'diff(y,x)=cos(x)·y + %e^sin(x);
sol:ode2(eq,y,x);
ic1(sol,x=0,y=3);
d sin ( x )
y =cos ( x ) y +%e
dx
sin ( x )
y =( x +%c ) %e
sin ( x )
y =( x +3 ) %e
Ques.5 - Solve dy/dx + y = x with IC y(0)=1
/*Answer-*/
eq:'diff(y,x)+y=x;
sol:ode2(eq,y,x);
ic1(sol,x=0,y=1);
d
y +y =x
dx
−x x
y =%e ( x −1 ) %e +%c
−x x
y =%e ( x −1 ) %e +2
86505.wxmx 8 / 60

Ques.1 Solve the IVP as second order differential


equation

y"+y'+2y=0 with y(0)=1 , y'(0)=b

and plot the solution for b=-3,-2,-1,0,1,2,3 as


y1,y2,y3,y4,y5,y6,y7 respectively

/*Answer-*/
$depends(y,x);
eq:diff(y,x,2)+3·diff(y,x)+2·y = 0;
sol:ode2(eq,y,x);
sol1:ic2(sol,x=0,y=1,diff(y,x)=b);

g1:ev(sol1,b=−3);
g2:ev(sol1,b=−2);
g3:ev(sol1,b=−1);
g4:ev(sol1,b=0);
g5:ev(sol1,b=1);
g6:ev(sol1,b=2);
g7:ev(sol1,b=3);

wxplot2d([rhs(g1),rhs(g2),rhs(g3),rhs(g4),rhs(g5),rhs(g6),rhs(g7)],[x,−10
[legend,"y1","y2","y3","y4","y5","y6","y7"]);
[ y( x ) ]
2
d d
y +3 y +2 y =0
2 dx
dx
−x −2 x
y =%k1 %e +%k2 %e
−x −2 x
y =( b +2 ) %e +( −b−1 ) %e
−2 x −x
y =2 %e −%e
−2 x
y =%e
−x
y =%e
−x −2 x
y =2 %e −%e
−x −2 x
y =3 %e −2 %e
86505.wxmx 9 / 60

−x −2 x
y =4 %e −3 %e
−x −2 x
y =5 %e −4 %e

Ques.2 Solve the IVP as second order differential


equation

y"+y'+-6y=0 with arbitrary constatnts k1 and k2

and plot the solution for (k1,k2) =


(1,0),(0,1),(1,1),(1,-1),(-1,1),(5,1),(1,5) as
y1,y2,y3,y4,y5,y6,y7 respectively.
/*Answer-*/
$depends(y,x);
eq:diff(y,x,2)+diff(y,x)−6·y = 0;
sol:ode2(eq,y,x);

gr1:ev(sol,%k1=1,%k2=0);
gr2:ev(sol,%k1=0,%k2=1);
gr3:ev(sol,%k1=1,%k2=1);
gr4:ev(sol,%k1=1,%k2=−1);
gr5:ev(sol,%k1=−1,%k2=1);
gr6:ev(sol,%k1=5,%k2=1);
gr7:ev(sol,%k1=1,%k2=5);

wxplot2d([rhs(gr1),rhs(gr2),rhs(gr3),rhs(gr4),rhs(gr5),rhs(gr6),rhs(gr7)],[x
[legend,"y1","y2","y3","y4","y5","y6","y7"]);
[ y( x ) ]
2
d d
y+ y −6 y =0
2 dx
dx
2x −3 x
y =%k1 %e +%k2 %e
2x
y =%e
86505.wxmx 10 / 60

−3 x
y =%e
2x −3 x
y =%e +%e
2x −3 x
y =%e −%e
−3 x 2x
y =%e −%e
2x −3 x
y =5 %e +%e
2x −3 x
y =%e +5 %e
plot2d: some values were clipped.
plot2d: some values were clipped.
plot2d: some values were clipped.
plot2d: some values were clipped.
plot2d: some values were clipped.
plot2d: some values were clipped.
plot2d: some values were clipped.

Ques.3 Solve the IVP as second order differential


equation

y"+-2y'+13y=0 with y(0)=1 , y'(0)=b

and plot the solution for b=4,5,6,7,8,9,10 as


y1,y2,y3,y4,y5,y6,y7 respectively.
86505.wxmx 11 / 60

/*Answer-*/
eq:'diff(y,x,2)−2·'diff(y,x)+13·y = 0;
sol:ode2(eq,y,x);
sol1:ic2(sol,x=0,y=1,'diff(y,x)=b);

g1:ev(sol1,b=4);
g2:ev(sol1,b=5);
g3:ev(sol1,b=6);
g4:ev(sol1,b=7);
g5:ev(sol1,b=8);
g6:ev(sol1,b=9);
g7:ev(sol1,b=10);

wxplot2d([rhs(g1),rhs(g2),rhs(g3),rhs(g4),rhs(g5),rhs(g6),rhs(g7)],[x,−1,1
[legend,"y1","y2","y3","y4","y5","y6","y7"]);
2
d d
y −2 y +13 y =0
2 dx
dx
x p p
y =%e ( %k1 sin( 2 3 x ) +%k2 cos ( 2 3 x ) )
p p p
x ( 3 b − 3 ) sin ( 2 3 x ) p
y =%e +cos ( 2 3 x )
6
p p
x 3 sin ( 2 3 x) p
y =%e +cos ( 2 3 x)
2
p
x 2 sin ( 2 3 x) p
y =%e p +cos ( 2 3 x)
3
p
x 5 sin ( 2 3 x) p
y =%e p +cos ( 2 3 x)
2 3
x p p p
y =%e 3 sin( 2 3 x ) +cos ( 2 3 x)
p
x 7 sin ( 2 3 x) p
y =%e p +cos ( 2 3 x)
2 3
p
x 4 sin ( 2 3 x) p
y =%e p +cos ( 2 3 x)
3

x 3/ 2 p
y =%e 3 sin ( 2 3 x) p
+cos ( 2 3 x)
2
86505.wxmx 12 / 60

Ques.4 Solve using desolve method

y"-6y'+13y=0 with y(0)=k2 and y'(0)=k1


and plot the solution for (k1,k2) =
(1,0),(0,1),(1,1),(1,-2) as
y1,y2,y3,y4 respectively.
/*Answer-*/
kill(all)$
eq:'diff(y(x),x,2)−6·'diff(y(x),x)+13·y(x) = 0;
sol:desolve(eq,y(x));
sol1:ev(sol,at('diff(y(x),x),x=0)=%k1,y(0)=%k2);

gr1:ev(sol1,%k1=1,%k2=0);
gr2:ev(sol1,%k1=0,%k2=1);
gr3:ev(sol1,%k1=1,%k2=1);
gr4:ev(sol1,%k1=1,%k2=2);

wxplot2d([rhs(gr1),rhs(gr2),rhs(gr3),rhs(gr4)],[x,−5,5],[y,−10,10],
[legend,"y1","y2","y3","y4"]);

2
d d
y( x ) −6 y( x ) +13 y( x ) =0
2 dx
dx
3x
y( x ) =%e (
d
sin ( 2 x ) 2 d x y( x ) − 6 y( 0 ) + 6 y( 0 )
x=0
+y( 0 ) cos( 2 x )
4
)
3x ( 6 %k2 + 2 ( %k1 − 6 %k2 ) ) sin ( 2 x )
y( x ) =%e ( +
4
%k2 cos ( 2 x ) )
3x
%e sin ( 2 x )
y( x ) =
2
3x 3 sin ( 2 x )
y( x ) =%e cos ( 2 x ) −
2
86505.wxmx 13 / 60

3x
y( x ) =%e ( cos ( 2 x ) −sin( 2 x ) )
3x 5 sin ( 2 x )
y( x ) =%e 2 cos ( 2 x ) −
2
plot2d: some values were clipped.
plot2d: some values were clipped.
plot2d: some values were clipped.
plot2d: some values were clipped.

Ques.5 Solve the IVP as second order differential


equation

y"+y'+-y=0 with arbitrary constatnts k1 and k2

and plot the solution for (k1,k2) =


(1,0),(0,1),(1,1),(1,-1),(-1,1),(5,1),(1,5) as
y1,y2,y3,y4,y5,y6,y7 respectively.
/*Answer-*/
$depends(y,x);
eq:diff(y,x,2)+diff(y,x)−y = 0;
sol:ode2(eq,y,x);

gr1:ev(sol,%k1=1,%k2=0);
gr2:ev(sol,%k1=0,%k2=1);
gr3:ev(sol,%k1=1,%k2=1);
gr4:ev(sol,%k1=1,%k2=−1);
gr5:ev(sol,%k1=−1,%k2=1);
gr6:ev(sol,%k1=5,%k2=1);
gr7:ev(sol,%k1=1,%k2=5);

wxplot2d([rhs(gr1),rhs(gr2),rhs(gr3),rhs(gr4),rhs(gr5),rhs(gr6),rhs(gr7)],[x
[legend,"y1","y2","y3","y4","y5","y6","y7"]);
[ y( x ) ]
2
d d
y+ y −y =0
2 dx
dx
p p
86505.wxmx 14 / 60

p p
( 5−1) x (− 5−1) x
2 2
y =%k1 %e +%k2 %e
p
( 5−1) x
2
y =%e
p
(− 5−1) x
2
y =%e
p p
( 5−1) x (− 5−1) x
2 2
y =%e +%e
p p
( 5−1) x (− 5−1) x
2 2
y =%e −%e
p p
(− 5−1) x ( 5−1) x
2 2
y =%e −%e
p p
( 5−1) x (− 5−1) x
2 2
y =5 %e +%e
p p
( 5−1) x (− 5−1) x
2 2
y =%e +5 %e
86505.wxmx 15 / 60

Ques.1 Solve the IVP as second order differential


equation

y'''+3*y''+4y'+12y=0 with y(0)=0 , y'(0)=a ,


y"(0)=0

and plot the solution for a=-3,-2,-1,0,1,2,3 as


y1,y2,y3,y4,y5,y6,y7 respectively
/*Answer-*/
eq:'diff(y(x),x,3)+3·'diff(y(x),x,2)+4·'diff(y(x),x)+12·y(x) = 0;
sol:desolve(eq,y(x));
sol1:ev(sol,at('diff(y(x),x,2),x=0)=0,at('diff(y(x),x),x=0)=a,y(0)=0);

g1:ev(sol1,a=−3);
g2:ev(sol1,a=−2);
g3:ev(sol1,a=−1);
g4:ev(sol1,a=0);
g5:ev(sol1,a=1);
g6:ev(sol1,a=2);
g7:ev(sol1,a=3);

wxplot2d([rhs(g1),rhs(g2),rhs(g3),rhs(g4),rhs(g5),rhs(g6),rhs(g7)],[x,−4,1
[legend,"y1","y2","y3","y4","y5","y6","y7"]);

3 2
d d d
y( x ) +3 y( x ) +4 y( x ) +12 y( x )
3 2 dx
dx dx
=0
y( x ) = sin( 2 x )
2
d d
3 y( x ) +13 d x y( x ) +12 y( 0 ) / 26 +
2
dx x=0
x=0
2
−3 x d
%e y( x ) + 4 y( 0 )
2
dx
x=0

13
86505.wxmx 16 / 60

2
d
cos ( 2 x ) y( x ) − 9 y( 0 )
2
dx
x=0

13
a sin ( 2 x )
y( x ) =
2
3 sin ( 2 x )
y( x ) =−
2
y( x ) =−sin( 2 x )
sin ( 2 x )
y( x ) =−
2
y( x ) =0
sin ( 2 x )
y( x ) =
2
y( x ) =sin( 2 x )
3 sin ( 2 x )
y( x ) =
2

Ques.2 Solve the IVP as second order differential


equation

y'''-6y''+5y'+12y=0 with y(0)=0 , y'(0)=a , y"(0)=0

and plot the solution for a=-3,-2,-1,0,1,2,3 as


y1,y2,y3,y4,y5,y6,y7 respectively
86505.wxmx 17 / 60

/*Answer-*/
eq:'diff(y(x),x,3)−6·'diff(y(x),x,2)+5·'diff(y(x),x)+12·y(x) = 0;
sol:desolve(eq,y(x));
sol1:ev(sol,at('diff(y(x),x,2),x=0)=0,at('diff(y(x),x),x=0)=a,y(0)=0);

g1:ev(sol1,a=−3);
g2:ev(sol1,a=−2);
g3:ev(sol1,a=−1);
g4:ev(sol1,a=0);
g5:ev(sol1,a=1);
g6:ev(sol1,a=2);
g7:ev(sol1,a=3);

wxplot2d([rhs(g1),rhs(g2),rhs(g3),rhs(g4),rhs(g5),rhs(g6),rhs(g7)],[x,−4,4
[legend,"y1","y2","y3","y4","y5","y6","y7"]);
3 2
d d d
y( x ) −6 y( x ) +5 y( x ) +12 y( x )
3 2 dx
dx dx
=0
y( x ) =
2
4x d d
%e y( x ) − 2 d x y( x ) − 3 y( 0 )
2
dx x=0
x=0

5
2
3x d d
%e y( x ) − 3 d x y( x ) − 4 y( 0 )
2
dx x=0
x=0
+
4
2
−x d d
%e y( x ) − 7 d x y( x ) + 12 y( 0 )
2
dx x=0
x=0

20
4x 3x −x
2 a %e 3 a %e 7 a %e
y( x ) =− + −
5 4 20
4x 3x −x
6 %e 9 %e 21 %e
y( x ) = − +
5 4 20
4x 3x −x
4 %e 3 %e 7 %e
y( x ) = − +
5 2 10
86505.wxmx 18 / 60

Ques.3 Solve the IVP as second order differential


equation

y'''+3*y''+2y'=0 with y(0)=0 , y'(0)=a , y"(0)=0

and plot the solution for a=-3,-2,-1,0,1,2,3 as


y1,y2,y3,y4,y5,y6,y7 respectively
/*Answer-*/
eq:'diff(y(x),x,3)+3·'diff(y(x),x,2)+2·'diff(y(x),x) = 0;
sol:desolve(eq,y(x));
sol1:ev(sol,at('diff(y(x),x,2),x=0)=0,at('diff(y(x),x),x=0)=a,y(0)=0);

g1:ev(sol1,a=−3);
g2:ev(sol1,a=−2);
g3:ev(sol1,a=−1);
g4:ev(sol1,a=0);
g5:ev(sol1,a=1);
g6:ev(sol1,a=2);
g7:ev(sol1,a=3);

wxplot2d([rhs(g1),rhs(g2),rhs(g3),rhs(g4),rhs(g5),rhs(g6),rhs(g7)],[x,−4,1
[legend,"y1","y2","y3","y4","y5","y6","y7"]);

3 2
d d d
y( x ) +3 y( x ) +2 y( x ) =0
3 2 dx
dx dx
2
d d
y( x ) + 3 d x y( x ) + 2 y( 0 )
2
dx x=0
x=0
y( x ) = +
2
2
−2 x d d
%e y( x ) + y( x )
2 dx
dx x=0
−x
x=0
+%e
2
2
d d
− y( x ) −2 d x y( x )
2
dx x=0
x=0
86505.wxmx 19 / 60

−2 x
−x a %e 3a
y( x ) =−2 a %e + +
2 2
−2 x
−x 3 %e 9
y( x ) =6 %e − −
2 2
−x −2 x
y( x ) =4 %e −%e −3
−2 x
−x %e 3
y( x ) =2 %e − −
2 2
y( x ) =0
−2 x
−x %e 3
y( x ) =−2 %e + +
2 2
−x −2 x
y( x ) =−4 %e +%e +3
−2 x
−x 3 %e 9
y( x ) =−6 %e + +
2 2

Ques.4 Solve the IVP as second order differential


equation

y'''-6y''+5y'+12y=1 with y(0)=0 , y'(0)=a , y"(0)=0

and plot the solution for a=-3,-2,-1,0,1,2,3 as


y1,y2,y3,y4,y5,y6,y7 respectively
86505.wxmx 20 / 60

/*Answer-*/
eq:'diff(y(x),x,3)−6·'diff(y(x),x,2)+5·'diff(y(x),x)+12·y(x) = 1;
sol:desolve(eq,y(x));
sol1:ev(sol,at('diff(y(x),x,2),x=0)=0,at('diff(y(x),x),x=0)=a,y(0)=0);

g1:ev(sol1,a=−3);
g2:ev(sol1,a=−2);
g3:ev(sol1,a=−1);
g4:ev(sol1,a=0);
g5:ev(sol1,a=1);
g6:ev(sol1,a=2);
g7:ev(sol1,a=3);

wxplot2d([rhs(g1),rhs(g2),rhs(g3),rhs(g4),rhs(g5),rhs(g6),rhs(g7)],[x,−4,4
[legend,"y1","y2","y3","y4","y5","y6","y7"]);
3 2
d d d
y( x ) −6 y( x ) +5 y( x ) +12 y( x )
3 2 dx
dx dx
=1
2
4x d d
y( x ) = %e (4 y( x ) −8 d x y( x )
2
dx x=0
x=0
2
3x d
−12 y( 0 ) +1 ) / 20 − %e (3 y( x ) −9
2
dx
x=0
d −x
y( x ) −12 y( 0 ) +1 ) / 12 + %e
dx
x=0
2
d d
y( x ) −7 d x y( x ) +12 y( 0 ) −1 / 20 + 1
2
dx x=0 12
x=0
4x 3x
( 1 − 8 a ) %e ( 1 − 9 a ) %e
y( x ) = − +
20 12
−x
( − 7 a − 1 ) %e 1
+
20 12
4x 3x
5 %e 7 %e −x 1
y( x ) = − +%e +
4 3 12
4x 3x −x
86505.wxmx 21 / 60

Ques.5 Solve the IVP as second order differential


equation

y'''+y''+y'+y=0 with y(0)=0 , y'(0)=a , y"(0)=0

and plot the solution for a=-3,-2,-1,0,1,2,3 as


y1,y2,y3,y4,y5,y6,y7 respectively
/*Answer-*/
eq:'diff(y(x),x,3)+'diff(y(x),x,2)+'diff(y(x),x)+y(x) = 0;
sol:desolve(eq,y(x));
sol1:ev(sol,at('diff(y(x),x,2),x=0)=0,at('diff(y(x),x),x=0)=a,y(0)=0);

g1:ev(sol1,a=−3);
g2:ev(sol1,a=−2);
g3:ev(sol1,a=−1);
g4:ev(sol1,a=0);
g5:ev(sol1,a=1);
g6:ev(sol1,a=2);
g7:ev(sol1,a=3);

wxplot2d([rhs(g1),rhs(g2),rhs(g3),rhs(g4),rhs(g5),rhs(g6),rhs(g7)],[x,−4,1
[legend,"y1","y2","y3","y4","y5","y6","y7"]);

3 2
d d d
y( x ) + y( x ) + y( x ) +y( x ) =0
3 2 dx
dx dx
y( x ) =
2
d d
sin ( x ) y( x ) + 2 d x y( x ) + y( 0 )
2
dx x=0
x=0
+
2
2
−x d
%e y( x ) + y( 0 )
2
dx
x=0

2
86505.wxmx 22 / 60

2
d
cos ( x ) y( x ) − y( 0 )
2
dx
x=0

2
y( x ) =a sin( x )
y( x ) =−3 sin( x )
y( x ) =−2 sin( x )
y( x ) =−sin( x )
y( x ) =0
y( x ) =sin( x )
y( x ) =2 sin( x )
y( x ) =3 sin( x )

Ques.1 Solve the differential equation

y"-y'-2y = e^3x

using variation of parameters


86505.wxmx 23 / 60

/*Ans - */
kill(all)$
eq:'diff(y,x,2)−'diff(y,x)−2·y=0; /*Homogeneous part of given eqn-*/
y:ode2(eq,y,x);
yc:second(y); /*complimentry function*/
a:second(second(second(y)));
b:second(first(second(y)));
M: matrix(
[a,b],
[diff(a,x),diff(b,x)]
);
W:determinant(M);
yp:−a·integrate(b·%e^(3·x)/W,x)+b·integrate(a·%e^(3·x)/W,x);/*particula
sol:yp+yc; /*general soln.*/

2
d d
y− y −2 y =0
2 dx
dx
2x −x
y =%k1 %e +%k2 %e
2x −x
%k1 %e +%k2 %e
−x
%e
2x
%e
−x 2x
%e %e
−x 2x
− %e 2 %e
x
3 %e
3x
%e
4
3x
%e 2x −x
+%k1 %e +%k2 %e
4
Ques.2 Solve the differential equation

y"+3y'+2y = sin 2x

using variation of parameters


86505.wxmx 24 / 60

/*Answer-*/
kill(all)$
eq:'diff(y,x,2)+3·'diff(y,x)+2·y=0; /*Homogeneous part of given eqn-*/
y:ode2(eq,y,x);
yc:second(y); /*complimentry function*/
a:second(second(second(y)));
b:second(first(second(y)));
M: matrix(
[a,b],
[diff(a,x),diff(b,x)]
);
W:determinant(M);
yp:−a·integrate(b·sin(2·x)/W,x)+b·integrate(a·sin(2·x)/W,x); /*particular i
sol:yp+yc; /*general soln.*/
2
d d
y +3 y +2 y =0
2 dx
dx
−x −2 x
y =%k1 %e +%k2 %e
−x −2 x
%k1 %e +%k2 %e
−2 x
%e
−x
%e
−2 x −x
%e %e
−2 x −x
− 2 %e − %e
−3 x
%e
sin ( 2 x ) − 2 cos ( 2 x ) 2 sin ( 2 x ) − 2 cos ( 2 x )

5 8
2 sin ( 2 x ) − 2 cos ( 2 x ) sin ( 2 x ) − 2 cos ( 2 x )
− + +
8 5
−x −2 x
%k1 %e +%k2 %e
86505.wxmx 25 / 60

Ques.3 Solve the following non-homogeneous


second order differential equation

y"-y'-2y = 4x^2

using variation of parameters


/*Answer-*/
kill(all)$
eq:'diff(y,x,2)−'diff(y,x)−2·y=0; /*Homogeneous part of given eqn-*/
y:ode2(eq,y,x);
yc:second(y); /*complimentry function*/
a:second(second(second(y)));
b:second(first(second(y)));
M: matrix(
[a,b],
[diff(a,x),diff(b,x)]
);
W:determinant(M);
yp:−a·integrate(b·(4·x^2)/W,x)+b·integrate(a·(4·x^2)/W,x); /*particular in
sol:yp+yc; /*general soln.*/

2
d d
y− y −2 y =0
2 dx
dx
2x −x
y =%k1 %e +%k2 %e
2x −x
%k1 %e +%k2 %e
−x
%e
2x
%e
−x 2x
%e %e
−x 2x
− %e 2 %e
x
3 %e
2 2
2 x +2 x+1 4 (x −2 x+2)
− −
3 3
86505.wxmx 26 / 60

2
2x −x 2 x +2 x+1
%k1 %e +%k2 %e − −
3
2
4 (x −2 x+2)
3
Ques.4 Solve the differential equation

y"-y'-y = e^5x

using variation of parameters


/*Ans - */
kill(all)$
eq:'diff(y,x,2)−'diff(y,x)−y=0; /*Homogeneous part of given eqn-*/
y:ode2(eq,y,x);
yc:second(y); /*complimentry function*/
a:second(second(second(y)));
b:second(first(second(y)));
M: matrix(
[a,b],
[diff(a,x),diff(b,x)]
);
W:determinant(M);
yp:−a·integrate(b·%e^(5·x)/W,x)+b·integrate(a·%e^(5·x)/W,x);/*particula
sol:yp+yc; /*general soln.*/

2
d d
y− y −y =0
2 dx
dx
p p
( 5+1) x (1− 5) x
2 2
y =%k1 %e +%k2 %e
p p
( 5+1) x (1− 5) x
2 2
%k1 %e +%k2 %e
p
(1− 5) x
2
%e
p
( 5+1) x
2
%e
86505.wxmx 27 / 60

p p
(1− 5) x ( 5+1) x
2 2
%e %e
p p
(1− 5) x ( 5+1) x
p 2 p 2
(1− 5 ) %e ( 5 + 1 ) %e
2 2
p p
( 5+1) x (1− 5) x
+
p 2 2
( 5 + 1 ) %e

2
p p
( 5+1) x (1− 5) x
+
p 2 2
(1− 5 ) %e
2
p 1 p
( 5+1) x 1− p 1− 5
+ 11 5 +5 x
2 − 2
2 2
%e

p 1 p
1− p 1− 5
5 11 5 +5
− 2
2 2
1 p p
1− p 5+1 (1− 5) x
5 11 +5 x+
+ 2 2
2 2
%e

p 1 p
1− p 5+1
5 5 11 +5
+ 2
2 2
1 p p
1− p 5+1 (1− 5) x
5 11 +5 x+
+ 2 2
2 2
%e
− +
p 1 p
1− p 5+1
5 5 11 +5
+ 2
2 2
p p
86505.wxmx 28 / 60

p 1 p
( 5+1) x 1− p 1− 5
+ 11 5 +5 x
2 − 2
2 2
%e
+%k1
p 1 p
1− p 1− 5
5 11 5 +5
− 2
2 2
p p
( 5+1) x (1− 5) x
2 2
%e +%k2 %e
Ques.5 Solve the differential equation

y"+y'+y = cos 2x

using variation of parameters


/*Answer-*/
kill(all)$
eq:'diff(y,x,2)+'diff(y,x)+y=0; /*Homogeneous part of given eqn-*/
y:ode2(eq,y,x);
yc:second(y); /*complimentry function*/
a:second(second(second(y)));
b:second(first(second(y)));
M: matrix(
[a,b],
[diff(a,x),diff(b,x)]
);
W:determinant(M);
yp:−a·integrate(b·cos(2·x)/W,x)+b·integrate(a·cos(2·x)/W,x); /*particular
sol:yp+yc; /*general soln.*/
2
d d
y+ y +y =0
2 dx
dx
x
− p p
2 3x 3x
y =%e %k1 sin +%k2 cos
2 2
x
− p p
2 3x 3x
%e %k1 sin +%k2 cos
2 2
p
p p
86505.wxmx 29 / 60

p
3x
%k2 cos
2
x

2
p
3x x
%k2 cos −
2 2

p p
3x
3 %k2 sin
2 1
− −
2 2

p p p
3x 3x
3 %k2 x sin %k2 cos
2 2
− −
4 2
4 4
− p p
3 p 3 2
%e x( 3 %e %k2 integrate( (48 x
3/ 2 3
sin( 4 x ) + 4 3 3/ 2 3 p
x −16 3 x cos ( 4 x ) +4 3 x −16
p p
3 x ) sin ( 3+2 ) x +( 16 p 3 x −4 3 3 / 2 x 3 sin( 4 x ) +
2 2 p
48 x cos ( 4 x ) +48 x ) cos ( 3+2 ) x +
3/ 2 3 p
43 x +16 3 x cos ( 2 x ) sin( 4 x ) +
3/ 2 3 p
−4 3 x −16 3 x sin( 2 x ) cos ( 4 x ) +
3/ 2 3 p
−4 3 x −16 3 x sin( 2 x ) /
4 2
p 2
9 %k2 x +24 %k2 x +16 %k2 sin ( 3+2 ) x +(
4
32 %k2 −18 %k2 x sin( 2 x ) +
3/ 2 3 p
83 %k2 x +32 3 %k2 x cos ( 2 x ) )
p
sin ( 3+2 ) x + 9 %k2 x 4 +24 %k2 x 2 +16 %k2
p 2
cos ( 3+2 ) x +( −8 3 3 / 2 %k2 x 3 −32 p 3 %k2 x

sin( 2 x ) + 32 %k2 −18 %k2 x 4 cos ( 2 x ) )


p
cos ( 3+2 ) x + 9 %k2 x 4 +24 %k2 x 2 +16 %k2
86505.wxmx p 30 / 60

2 2
sin( 2 x ) + 9 %k2 x 4 +24 %k2 x 2 +16 %k2 cos ( 2 x ) ,x
8
p p
2 3 %i x − 4 p 3
)+%i expintegral_e 1 , p + 3 %e
3
p
2 3 %i x + 4
expintegral_e 1 , p −%i
3
8
p p
2 3 %i x − 4 p 3
expintegral_e 1 , p + 3 %e
3
p
2 3 %i x − 4
expintegral_e 1 ,− p )/ + %k2
3
p
3x
cos
2

x cos ( 2 x )
p p
dx / 2
p 3x 3x
3 %k2 x sin %k2 cos
2 2
− −
4 2
4 4
− p p
3 p 3 2
%e x( 3 %e %k2 integrate( (48 x
3/ 2 3
sin( 4 x ) + 4 3 3 / 2 x 3 −16 p 3 x cos ( 4 x ) +4 3 x −16
p p
3 x ) sin ( 3+2 ) x +( 16 p 3 x −4 3 3 / 2 x 3 sin( 4 x ) +
2 2 p
48 x cos ( 4 x ) +48 x ) cos ( 3+2 ) x +
3/ 2 3 p
43 x +16 3 x cos ( 2 x ) sin( 4 x ) +
3/ 2 3 p
−4 3 x −16 3 x sin( 2 x ) cos ( 4 x ) +
3/ 2 3 p
−4 3 x −16 3 x sin( 2 x ) /
4 2
p 2
9 %k2 x +24 %k2 x +16 %k2 sin ( 3+2 ) x +(
4
32 %k2 −18 %k2 x sin( 2 x ) +
86505.wxmx 31 / 60

3/ 2 3 p
83 %k2 x +32 3 %k2 x cos ( 2 x ) )
p
sin ( 3+2 ) x + 9 %k2 x 4 +24 %k2 x 2 +16 %k2
p 2
cos ( 3+2 ) x +( −8 3 3 / 2 %k2 x 3 −32 p 3 %k2 x

sin( 2 x ) + 32 %k2 −18 %k2 x 4 cos ( 2 x ) )


p
cos ( 3+2 ) x + 9 %k2 x 4 +24 %k2 x 2 +16 %k2
2 2
sin( 2 x ) + 9 %k2 x 4 +24 %k2 x 2 +16 %k2 cos ( 2 x ) ,x
8
p p
2 3 %i x − 4 p 3
)+%i expintegral_e 1 , p + 3 %e
3
p
2 3 %i x + 4
expintegral_e 1 , p −%i
3
8
p p
2 3 %i x − 4 p 3
expintegral_e 1 , p + 3 %e
3
p
2 3 %i x − 4
expintegral_e 1 ,− p )/ + %k2
3
p
3x
cos
2

x cos ( 2 x )
p p
dx / 2+
p 3x 3x
3 %k2 x sin %k2 cos
2 2
− −
4 2
x
− p p
2 3x 3x
%e %k1 sin +%k2 cos
2 2
86505.wxmx 32 / 60

Ques.1 - Solve the following system

x' = 2x + 3y
y' = 4x + 3y
/*Answer-*/
eq1: 'diff(x(t),t,1)=2·x(t) +3·y(t);
eq2: 'diff(y(t),t,1)=4·x(t) + 3·y(t);
d
x( t ) =3 y( t ) +2 x( t )
dt
d
y( t ) =3 y( t ) +4 x( t )
dt
M: matrix([2,3], [4,3]);
2 3
4 3
eigenvalues(M);
[ [ 6 ,−1] ,[ 1 ,1 ] ]
Since the eigenvalues are a=6 & b=(-1) are real
& distinct, therefore the solution
[x,y]= c1*k1*e^(a*t) + c2*k2*e^(bt)
where k1 & k2 are the eigenvectors corresponding
to a & b resp.
c1 & c2 are arbitrary constants.
eigenvectors(M);
4
[ [ [ 6 ,−1] ,[ 1 ,1 ] ] ,[ [ [ 1 , ] ] ,[ [ 1 ,−1] ] ] ]
3
sol: [x,y]= c1·[1,4/3]·%e^(6·t) + c2·[1,−1]·%e^(−1·t);
6t
6t − t 4 c1 %e
[ x ,y ] =[ c1 %e +c2 %e , −c2
3
86505.wxmx 33 / 60

−t
%e ]
part(sol,1,1)=part(sol,2,1);
6t −t
x =c1 %e +c2 %e
part(sol,1,2)=part(sol,2,2);
6t
4 c1 %e −t
y= −c2 %e
3
/*%o26 and %o27 are the solutions of the given system of equation*/
Ques.2 - Solve the following system

x' = x - y +8z
y' = 10y - 2Z
z' = 9z
/*Answer-*/
eq1: 'diff(x(t),t,1)= x(t)−y(t)+8·z(t);
d
x( t ) =8 z ( t ) −y( t ) +x( t )
dt
eq2: 'diff(y(t),t,1)=10·y(t)−2·z(t);
d
y( t ) =10 y( t ) −2 z( t )
dt
eq3: 'diff(z(t),t,1)=9·z(t);
d
z ( t ) =9 z ( t )
dt
M: matrix([1,−1,8],[0,10,−2],[0,0,9]);
1 −1 8
0 10 − 2
0 0 9
eigenvalues(M);
[ [ 1 ,9 ,10 ] ,[ 1 ,1 ,1 ] ]
86505.wxmx 34 / 60

since the eigenvalues a=1, b=9, c=10


are real & distinct, the solution
[x,y,z]= c1*k1*e^(a*t)
+c2*k2*e^(b*t)
+c3*k3*e^(c*t)
where k1, k2 & k3 are eigenvectors
corresonding to a, b & c resp.
and c1, c2 & c3 are arbitrary constants.

eigenvectors(M);
8 4
[ [ [ 1 ,9 ,10 ] ,[ 1 ,1 ,1 ] ] ,[ [ [ 1 ,0 ,0 ] ] ,[ [ 1 , , ]
3 3
] ,[ [ 1 ,−9 ,0 ] ] ] ]
sol: [x,y,z]= c1·[1,0,0]·%e^(1·t)
+c2·[1,8/3,4/3]·%e^(9·t)
+c3·[1,−9,0]·%e^(10·t);
10 t 9t t
[ x ,y ,z] =[ c3 %e +c2 %e +c1 %e ,
9t 9t
8 c2 %e 10 t 4 c2 %e
−9 c3 %e , ]
3 3
part(sol,1,1)=part(sol,2,1);
10 t 9t t
x =c3 %e +c2 %e +c1 %e
part(sol,1,2)=part(sol,2,2);
9t
8 c2 %e 10 t
y= −9 c3 %e
3
part(sol,1,3)=part(sol,2,3);
9t
4 c2 %e
z=
3
/*%o35, %o36 and %o37 are the solutions of the given system of equati
Ques.3 Solve the following system

x' = 3x - 2y
y' = 2x - 2y with [x(0),y(0)]=[1,-1]
86505.wxmx 35 / 60

/*Answer-*/
kill(all)$
eq1:diff(x(t),t)=3·x(t)−2·y(t);
eq2:diff(y(t),t)=2·x(t)−2·y(t);
atvalue(x(t),t=0,1);
atvalue(y(t),t=0,−1);
desolve([eq1,eq2],[x(t),y(t)]);
d
x( t ) =3 x( t ) −2 y( t )
dt
d
y( t ) =2 x( t ) −2 y( t )
dt
1
−1
2t −t 2t −t
[ x( t ) =2 %e −%e , y( t ) =%e −2 %e ]
Ques.4 Solve the following system

x' = x + 2y
y' = x/2 + y with [x(0),y(0)]=[16,-2]

/*Answer-*/
kill(all)$
eq1:diff(x(t),t)=x(t)+2·y(t);
eq2:diff(y(t),t)=x(t)/2+y(t);
atvalue(x(t),t=0,16);
atvalue(y(t),t=0,−2);
desolve([eq1,eq2],[x(t),y(t)]);
d
x( t ) =2 y( t ) +x( t )
dt
d x( t )
y( t ) =y( t ) +
dt 2
16
−2
2t 2t
[ x( t ) =6 %e +10 , y( t ) =3 %e −5]
Ques.5 Solve the following system

x1' = 3x1 - 2x2


x2' = 2x1 - 2x2 with x1(0)=3, x2(0)= 1/2
86505.wxmx 36 / 60

/*Answer-*/
kill(all)$
eq1:diff(x1(t),t)=3·x1(t)−2·x2(t);
eq2:diff(x2(t),t)=2·x1(t)−2·x2(t);
atvalue(x1(t),t=0,3);
atvalue(x2(t),t=0,1/2);
desolve([eq1,eq2],[x1(t),x2(t)]);
d
x1( t ) =3 x1( t ) −2 x2( t )
dt
d
x2( t ) =2 x1( t ) −2 x2( t )
dt
3
1
2
2t −t 2t
11 %e 2 %e 11 %e
[ x1( t ) = − , x2 ( t ) = −
3 3 6
−t
4 %e
]
3
Ques.5 Solve the following system

x' = 4x - 7y
y' = x - 2y with [x(0),y(0)]=[1,-1]

/*Answer-*/
kill(all)$
eq1:diff(x(t),t)=4·x(t)−7·y(t);
eq2:diff(y(t),t)=x(t)−2·y(t);
atvalue(x(t),t=0,1);
atvalue(y(t),t=0,−1);
desolve([eq1,eq2],[x(t),y(t)]);
d
x( t ) =4 x( t ) −7 y( t )
dt
d
y( t ) =x( t ) −2 y( t )
dt
1
−1
86505.wxmx 37 / 60

t p p p
[ x( t ) =%e ( 5 2 sinh ( 2 t ) +cosh ( 2 t ) ) , y( t )

t 3/ 2 p p
=%e 2 sinh ( 2 t ) −cosh ( 2 t) ]

Ques.1 Solve Ux - Uy = 1 U(x,y)=x^2

Soln. The charecteristic equations is


dx/1=dy/(-1)=du/1
we consider dy/dx=(-1) and du/dx=1
/*Answer-*/
eq1:'diff(y,x)=−1;
d
y =−1
dx
ode2(eq1,y,x);
y =%c −x
solve(%o10,%c);
[ %c =y +x ]
eq2:'diff(u,x)=1;
d
u =1
dx
ode2(eq2,u,x);
u =x +%c
solve(%o14,%c);
[ %c =u −x ]
86505.wxmx 38 / 60

The general soln of the given PDE is given by


c1=f(c2) or c2=f(c1) where f is an arbitrary function.
u−x=f(y+x);
u−x =f ( y +x )
u(x,y):=x+f(y+x);
u ( x ,y ) :=x +f ( y +x )
u(x,0)=x^2;
2
f ( x ) +x =x
f(x):=x^2−x;
2
f ( x ) :=x −x
'u(x,y)=u(x,y);
2
u ( x ,y ) =( y +x ) −y
wxplot3d(u(x,y),[x,−10,10],[y,−10,10]);

Ques.2- Solve x*ux+y*uy=x*exp(-u); u(x,x^2)=0

Soln. The charecteristic equations is


dx/x=dy/y=du/x*exp(-u
we consider dy/dx=y/x and du/dx=exp(-u)
/*Answer-*/
eq1:'diff(y,x)=y/x;
d y
y=
dx x
ode2(eq1,y,x);
y =%c x
solve(%o24,%c);
y
[ %c = ]
x
eq2:'diff(u,x)=exp(−u);
d −u
u =%e
dx
ode2(eq2,u,x);
86505.wxmx 39 / 60

u
%e =x +%c
solve(%o27,%c);
u
[ %c = %e −x ]
exp(u)−x=g(y/x);
u y
%e −x =g
x
u(x,y):=log(x+g(y/x));
y
u ( x ,y ) :=log x +g
x
u(x,x^2)=0;
log ( g ( x ) +x ) = 0
solve(%o31,g(x));
[ g ( x ) =1−x ]
g(x):=1−x;
g ( x ) :=1 −x
'u(x,y)=u(x,y);
y
u ( x ,y ) =log − +x +1
x
wxplot3d(u(x,y),[x,−10,10],[y,−10,10]);

Ques.3 Solve Ux - Uy = 1 U(x,y)=x^3

Soln. The charecteristic equations is


dx/1=dy/(-1)=du/1
we consider dy/dx=(-1) and du/dx=1
/*Answer-*/
eq1:'diff(y,x)=−1;
d
y =−1
dx
ode2(eq1,y,x);
y =%c −x
solve(%o10,%c);
86505.wxmx 40 / 60

[]
eq2:'diff(u,x)=1;
d
u =1
dx
ode2(eq2,u,x);
u =x +%c
solve(%o14,%c);
[]
The general soln of the given PDE is given by
c1=f(c2) or c2=f(c1) where f is an arbitrary function.
u−x=f(y+x);
3
u−x =( y +x ) −y −x
u(x,y):=x+f(y+x);
u ( x ,y ) :=x +f ( y +x )
u(x,0)=x^3;
3 3
x =x
f(x):=x^3−x;
3
f ( x ) :=x −x
'u(x,y)=u(x,y);
3
u ( x ,y ) =( y +x ) −y
wxplot3d(u(x,y),[x,−10,10],[y,−10,10]);

Ques.4- Solve x*ux+y*uy=x*exp(-u); u(x,x^4)=1

Soln. The charecteristic equations is


dx/x=dy/y=du/x*exp(-u
we consider dy/dx=y/x and du/dx=exp(-u)
/*Answer-*/
eq1:'diff(y,x)=y/x;
86505.wxmx 41 / 60

d y
y=
dx x
ode2(eq1,y,x);
y =%c x
solve(%o24,%c);
[]
eq2:'diff(u,x)=exp(−u);
d −u
u =%e
dx
ode2(eq2,u,x);
u
%e =x +%c
solve(%o27,%c);
[]
exp(u)−x=g(y/x);
u y
%e −x =1−
x
u(x,y):=log(x+g(y/x));
y
u ( x ,y ) :=log x +g
x
u(x,x^4)=1;
log −x 3 +x +1 =1
solve(%o31,g(x));
[]
g(x):=1−x;
g ( x ) :=1 −x
'u(x,y)=u(x,y);
y
u ( x ,y ) =log − +x +1
x
wxplot3d(u(x,y),[x,−10,10],[y,−10,10]);
86505.wxmx 42 / 60

Ques.5 Solve Ux - Uy =1 U(x,y)=x^3

Soln. The charecteristic equations is


dx/1=dy/(-1)=du/1
we consider dy/dx=(-1) and du/dx=1
/*Answer-*/
eq1:'diff(y,x)=−1;
d
y =−1
dx
ode2(eq1,y,x);
y =%c −x
solve(%o10,%c);
[]
eq2:'diff(u,x)=1;
d
u =1
dx
ode2(eq2,u,x);
u =x +%c
solve(%o14,%c);
[]
The general soln of the given PDE is given by
c1=f(c2) or c2=f(c1) where f is an arbitrary function.
u−x=f(y+x);
3
u−x =( y +x ) −y −x
u(x,y):=x+f(y+x);
u ( x ,y ) :=x +f ( y +x )
u(x,0)=x^3;
3 3
x =x
f(x):=x^3−x;
3
f ( x ) :=x −x
'u(x,y)=u(x,y);
3
u ( x ,y ) =( y +x ) −y
wxplot3d(u(x,y),[x,−10,10],[y,−10,10]);
86505.wxmx 43 / 60

Ques. 1 - x*ux + y*uy = u

Characteristic Eqns are : dx/x = dy/y = du/u

We first consider eqn1: dx/x= dy/y


/*Answer-*/
kill(all);
done
eq1: 'diff(y,x)=y/x;
d y
y=
dx x
ode2(eq1,y,x);
y =%c x
psol: makelist(%c·x, %c, 0,9);
[ 0 ,x , 2 x , 3 x , 4 x , 5 x , 6 x , 7 x , 8 x , 9 x ]
wxplot2d(psol,[x,−10,10]);

/* now we consider eqn2= du/dx=u/x */

eq2: 'diff(u,x)=u/x;
d u
u=
dx x
86505.wxmx 44 / 60

ode2(eq2,u,x);
u =%c x
psol: makelist(%c·x, %c, −3,8);
[ −3 x ,−2 x ,−x , 0, x , 2 x , 3 x , 4 x , 5 x , 6 x , 7 x , 8 x ]
wxplot3d(−3·x, [x,−10,10], [y,−10,10]);

Ques.2 - y*ux + x*uy = xy


The Characteristic eqns are : dx/y = dy/x = du/xy

considering the first eqn: dy/dx=x/y

/*Answer-*/
kill(all);
done
eq:'diff(y,x)=x/y;
d x
y=
dx y
ode2(eq,y,x);
2 2
y x
= +%c
2 2
programmode: false;
false
solve(%o4,y);
solve: solution:
q
2
y =− x +2 %c
q
2
y = x +2 %c
[ %t11 ,%t12 ]
psol1: makelist(ev(rhs(%t11)),%c,−2,3);
q q q q
2 2 2 2
[− x −4 ,− x −2 ,− x ,− x +2 ,− x +4 ,−
q
2
x +6]
psol2: makelist(ev(rhs(%t12)),%c,−2,3);
q q q q q
86505.wxmx 45 / 60

q q q q q
2 2 2 2 2
[ x −4 , x −2 , x , x +2 , x +4 , x +6]
plot1: wxplot2d( psol1,[x,−10,10]);
plot2d: expression evaluates to non−numeric value somewhere in p
plot2d: expression evaluates to non−numeric value somewhere in p

plot2: wxplot2d( psol2,[x,−10,10]);


plot2d: expression evaluates to non−numeric value somewhere in p
plot2d: expression evaluates to non−numeric value somewhere in p

/*other characteristic eqn: dx/y=du/xy */

eq2: 'diff(u,x)=x;
d
u =x
dx
ode2(eq2,u,x);
2
x
u= +%c
2
makelist(ev(rhs(%o19)),%c,−3,4);
2 2 2 2 2 2 2
x x x x x x x
[ −3 , −2 , −1 , , +1 , +2 ,
2 2 2 2 2 2 2
2
x
+3 , +4]
2
wxplot3d( x^2/2−3,[x,−9,9],[y,−5,5]);
86505.wxmx 46 / 60

Ques.3 - (u+y) *ux +y*uy = x-y

The Charecteristic eqns are: dx/(u+y) = dy/y =


du/(x-y)

first consider: dx+du/(u+x)= = dy/y.

let u+x=t, then,

The considered Eqn reduces to dt/t= dy/y

/*Answer-*/
kill(all);
done
eq1:'diff(y,t)=y/t;
d y
y=
dt t
ode2(eq1,y,t);
y =%c t
subst(u+x, t, %o2);
y =%c ( x +u )
solve(%o3,u);
solve: solution:
y − %c x
u=
%c
[ %t4 ]
psol:makelist( ev(rhs(%t4)),%c,2,5);
y −2 x y −3 x y −4 x y −5 x
[ , , , ]
2 3 4 5
wxplot3d((y−2·x)/2,[x,−7,8],[y,2,5]);
86505.wxmx 47 / 60

/* other characteristic eqn is (dx-dy)/u= du/(x-y),

which is same as (x-y)*(dx-dy)=u*du

let z=x-y, then we get z*dz=u*du


*/

eq2: 'diff(u,z)=z/u;
d z
u=
dz u
ode2(eq2,u,z);
2 2
u z
= +%c
2 2
solve(%,u);
solve: solution:
q
2
u =− z +2 %c
q
2
u = z +2 %c
[ %t10 ,%t11 ]
sub1: subst(x−y,z,%t10);
q
2
u =− ( x −y ) +2 %c
sub2: subst(x−y, z, %t11);
q
2
u = ( x −y ) +2 %c
psol1: makelist(ev(rhs(%o13)),%c,−3,6);
q q q
2 2 2
[− ( x −y ) −6 ,− ( x −y ) −4 ,− ( x −y ) −2
q q
2 2
,− y −x ,− ( x −y ) +2 ,− ( x −y ) +4 ,−
q q q
2 2 2
( x −y ) +6 ,− ( x −y ) +8 ,− ( x −y ) +10 ,−
q
2
( x −y ) +12 ]
psol2: makelist(ev(rhs(%o14)),%c,−3,6);
q q q
2 2 2
[ ( x −y ) −6 , ( x −y ) −4 , ( x −y ) −2 ,
q q q
2 2 2
y −x , ( x −y ) +2 , ( x −y ) +4 , ( x −y ) +6 ,
q q q
86505.wxmx q q q 48 / 60

q q q
2 2 2
( x −y ) +8 , ( x −y ) +10 , ( x −y ) +12 ]
wxplot3d(−sqrt((x−y)^2−6),[x,−10,10],[y,−10,10]);

wxplot3d(sqrt((x−y)^2−6),[x,−10,10],[y,−10,10]);

Ques.4 -

u*(x+y)*ux + u*(x-y)*uy = x^2+ y^2

Charecterisrtic eqns are : dx/u*(x+y) = dy/u*(x-y)=


du/(x^2+y^2)

considering first eqn: dy/dx= (x-y)/(x+y)


/*Answer-*/
kill(all);
done
eq1:'diff(y,x)= (x−y)/(x+y);
d x−y
y=
dx y +x
od:ode2(eq1,y,x);
2 2
y +2 x y −x
=%c
2
programmode:false;
false
solve(%o2,y);
solve: solution:
q
p 2
y =− 2 x +%c −x
q
p 2
y = 2 x +%c −x
[ %t4 ,%t5 ]
psol1: subst(7,%c,%t4);
q
p
86505.wxmx 49 / 60

q
p 2
y =− 2 x +7−x
psol2: subst(7,%c,%t5);
q
p 2
y = 2 x +7−x
wxplot2d([ev(rhs(psol1)),ev(rhs(psol2))],[x,−5,5]);

/*the other characteristic eqn is :


(x*dx -y*dy)/ u*(x^2+ y^2) = du/(x^2+y^2)

which reduces to,


(x*dx-y*dy)=u*du.

let k=(x^2+y^2)/2
then, dk= x*dx + y*dy

thus eqn smplifies to dk=u*du


*/
kill(all);
eq2: 'diff(u,k)=1/u;
done
d 1
u=
dk u
ode2(eq2,u,k);
2
u
=k +%c
2
subst((x^2−y^2)/2, k,%);
2 2 2
u x −y
= +%c
2 2
subst(8,%c,%);
2 2 2
u x −y
= +8
2 2
solve(%,u);
solve: solution:
q
2 2
u =− −y +x +16
q
86505.wxmx q 50 / 60

q
2 2
u = −y +x +16
[ %t5 ,%t6 ]
wxplot3d(ev(rhs(%t5)),[x,−3,3],[y,−8,9]);

wxplot3d(ev(rhs(%t6)),[x,−3,3],[y,−8,9]);

Ques. 5- x*ux + y*uy = u

Characteristic Eqns are : dx/x = dy/y = du/u

We first consider eqn1: dx/x= dy/y


/*Answer-*/
kill(all);
done
eq1: 'diff(y,x)=y/x;
d y
y=
dx x
ode2(eq1,y,x);
y =%c x
psol: makelist(%c·x, %c, 0,9);
[ 0 ,x , 2 x , 3 x , 4 x , 5 x , 6 x , 7 x , 8 x , 9 x ]
wxplot2d(psol,[x,−10,10]);

/* now we consider eqn2= du/dx=u/x */

eq2: 'diff(u,x)=u/x;
d u
u=
dx x
86505.wxmx 51 / 60

ode2(eq2,u,x);
u =%c x
psol: makelist(%c·x, %c, −3,8);
[ −3 x ,−2 x ,−x , 0, x , 2 x , 3 x , 4 x , 5 x , 6 x , 7 x , 8 x ]
wxplot3d(−3·x, [x,−10,10], [y,−10,10]);

Ques. 1 - Find the integral surface of the eqn


u*ux+uy =1,
so that the surface passes through an inital curve
represented paramatrically
by x(s,0)=2s^2 , y(s,0)=2s and u(s,0)=0 where s>0 is a
parameter

Soln- The char eqns are dx/u = dy/1 = du/1 = dt (let)


where t is another parameter .
so the reduces parametrically to:
dx/dt = u; x(0)= 2*s^2;
dx/dt = 1; y(0)= 2*s;
du/dt = 1; u(0)=0;
/*Answer-*/
programmode:true$
a:'diff(u,t)=1;
d
u =1
dt
ode2(a,u,t);
u =t +%c
86505.wxmx 52 / 60

a1:solve(%o11,u);
[ u =t +%c ]
b:'diff(y,t)=1;
d
y =1
dt
ode2(b,y,t);
y =t +%c
b1:solve(%o14,y);
[ y =t +%c ]
d:'diff(x,t)=t+%c;
d
x =t +%c
dt
ode2(d,x,t);
2
t
x= +%c t +%c
2
d1:solve(%o20,x);
2
t + 2 %c t + 2 %c
[ x= ]
2
subst([t=0,x=2·s^2],d1);
2
[ 2 s =%c ]
subst([t=0,y=2·s],b1);
[ 2 s=%c ]
subst([t=0,u=0·s^2],a1);
[ 0=%c ]
'x=t^2/2+2·s^2;
2
t 2
x= +2 s
2
'y=t+2·s;
y =t +2 s
'u=t+0;
u =t
load(draw);
C:/maxima−5.44.0/share/maxima/5.44.0/share/draw/draw.lisp
wxdraw3d(color=green,parametric(2·s^2,2·s,0,s,−100,100),title="Initial c
86505.wxmx 53 / 60

wxdraw3d(color=red,parametric_surface(t^2/2+2·s^2,t+2·s,t,s,−100,100

wxdraw3d( [color=cyan, parametric_surface((t^2+4·s^2)/2,2·s+t,t,s,−100


color=magenta,parametric(2·s^2,2·s,0,s,−100,100)],
title="Integral surface with integral curve");

Ques.2 -
repeat Ques. 1 of practical 8 with the following
conditions
x(s,0)=s^2/2, y(s,0)=s, u(s,0)=s
/*Answer-*/
kill(all);
done
a:'u=t+c1;
u =t +c1
subst([t=0,u=s],a);
s=c1
a1:subst([c1=s],a);
u =t +s
b:'y=t+c2;
y =t +c2
subst([t=0,y=s],b);
s=c2
b1:subst([c2=s],b);
y =t +s
c:'x=t^2/2+c1·t+c3;
2
t
x= +c1 t +c3
2
subst([t=0,x=s^2/2],c);
86505.wxmx 54 / 60

2
s
=c3
2
c1: subst([c3=(s^2)/2, c1=s],c);
2 2
t s
x= +s t +
2 2
load(draw)$
wxdraw3d( color=blue, parametric(s^2/2,s,s,s,−20,20),
title="Initial Curve");

wxdraw3d(color=yellow, parametric_surface(t^2/2+s·t+(s^2)/2,t+s,t+s,s,−
,t,−500,500),title="Integral Surface");

wxdraw3d( [color=yellow, parametric_surface(t^2/2+s·t+s^2/2,t+s,t+s,s,−


,t,−300,300),color=blue, parametric(s^2/2,s,s,s,−200,200)],
title="Integral surface with Initial Curve");
86505.wxmx 55 / 60

Ques.3 - Solve the cauchy problem


ux- uy=2
with cauchy data :
x(0)=s, y(0)=s , u(0)=2s.

also plot theintegral surface passing through initial


curve.

the characteristic eqns are: dx/1 = dy/(-1) = du/2


=dt
which tranforms in paramteric form as:

dx/dt=1 , x(0)=s
dy/dt=(-1) , y(0)=s
du/dt=2 , u(0)=2s

/*Answer-*/
kill(all);
done
a:'diff(x,t)=1;
d
x =1
dt
o1:ode2(%,x,t);
x =t +%c
a1:subst([%c=c1],%);
x =t +c1
a11:subst([t=0,x=s],%);
s=c1
eq1:subst([c1=s],a1);
x =t +s
b:'diff(y,t)=−1;
d
y =−1
dt
ode2(%,y,t);
y =%c −t
b2:subst([%c=c2],%);
y =c2−t
86505.wxmx 56 / 60

b22:subst([t=0,y=s],%);
s=c2
eq2:subst([c2=s],b2);
y =s−t
c:'diff(u,t)=2;
d
u =2
dt
ode2(%,u,t);
u =2 t +%c
C3:subst([%c=c3],%);
u =2 t +c3
c33:subst([t=0,u=2·s],%);
%o13
eq3: subst([c3=2·s],C3);
u =2 t + 2 s
load(draw)$
wxdraw3d(color=red, parametric(s,s,2·s,s,−10,10),title="Initial curve");

wxdraw3d( color=orange, parametric_surface(t+s, s−t, 2·t+2·s, s,−10,10


title="Integral Surface");

wxdraw3d([color=orange, parametric_surface(t+s, s−t, 2·t+2·s, s,−10,10


color=red, parametric(s,s,2·s,s,−10,10)],
title="Integral Surface and Initial Curve");
86505.wxmx 57 / 60

Ques. 4 - Find the integral surface of the eqn


u*ux+uy =5,
so that the surface passes through an inital curve
represented paramatrically
by x(s,0)=2s^2 , y(s,0)=2s and u(s,0)=0 where s>0 is a
parameter

Soln- The char eqns are dx/u = dy/1 = du/1 = dt (let)


where t is another parameter .
so the reduces parametrically to:
dx/dt = u; x(0)= 2*s^2;
dx/dt = 1; y(0)= 2*s;
du/dt = 1; u(0)=0;
/*Answer-*/
programmode:true$
a:'diff(u,t)=5;
d
u =5
dt
ode2(a,u,t);
u =5 t +%c
a1:solve(%o11,u);
[ u =5 t +%c ]
b:'diff(y,t)=1;
d
y =1
dt
ode2(b,y,t);
y =t +%c
b1:solve(%o14,y);
[ y =t +%c ]
d:'diff(x,t)=t+%c;
d
x =t +%c
dt
ode2(d,x,t);
2
t
x= +%c t +%c
2
d1:solve(%o20,x);
86505.wxmx 58 / 60

[]
subst([t=0,x=2·s^2],d1);
[]
subst([t=0,y=2·s],b1);
[ 2 s=%c ]
subst([t=0,u=0·s^2],a1);
[ 0=%c ]
'x=t^2/2+2·s^2;
2
t 2
x= +2 s
2
'y=t+2·s;
y =t +2 s
'u=t+0;
u =t
load(draw);
; file: C:/maxima-5.45.1/share/maxima/5.45.1/share/draw/grcommon.lisp
; in: DEFUN UPDATE-POINTTYPE
; (POSITION MAXIMA::VAL MAXIMA::SHAPES)
; ➔ CASE LET IF
; ==>
; (PROGN)
;
; caught STYLE-WARNING:
; This is not a NUMBER:
; NIL
; See also:
; The SBCL Manual, Node "Handling of Types"
;
; compilation unit finished
; caught 1 STYLE-WARNING condition
C:/maxima−5.45.1/share/maxima/5.45.1/share/draw/draw.lisp
wxdraw3d(color=green,parametric(2·s^2,2·s,0,s,−100,100),title="Initial c
86505.wxmx 59 / 60

wxdraw3d(color=red,parametric_surface(t^2/2+2·s^2,t+2·s,t,s,−100,100

wxdraw3d( [color=cyan, parametric_surface((t^2+4·s^2)/2,2·s+t,t,s,−100


color=magenta,parametric(2·s^2,2·s,0,s,−100,100)],
title="Integral surface with integral curve");

Ques.5 -
repeat Ques. 1 of practical 8 with the following
conditions
x(s,0)=s^3/2, y(s,0)=s, u(s,0)=s
/*Answer-*/
kill(all);
done
a:'u=t+c1;
u =t +c1
subst([t=0,u=s],a);
s=c1
a1:subst([c1=s],a);
u =t +s
b:'y=t+c2;
y =t +c2
subst([t=0,y=s],b);
s=c2
86505.wxmx 60 / 60

b1:subst([c2=s],b);
y =t +s
c:'x=t^2/2+c1·t+c3;
2
t
x= +c1 t +c3
2
subst([t=0,x=s^3/2],c);
3
s
=c3
2
c1: subst([c3=(s^3)/2, c1=s],c);
2 3
t s
x= +s t +
2 2
load(draw)$
wxdraw3d( color=blue, parametric(s^3/2,s,s,s,−20,20),
title="Initial Curve");

wxdraw3d(color=yellow, parametric_surface(t^3/2+s·t+(s^3)/2,t+s,t+s,s,−
,t,−500,500),title="Integral Surface");

wxdraw3d( [color=yellow, parametric_surface(t^3/2+s·t+s^3/2,t+s,t+s,s,−


,t,−300,300),color=blue, parametric(s^3/2,s,s,s,−200,200)],
title="Integral surface with Initial Curve");

You might also like