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

Practical - 4: First Order Partial Differential Equation

The document contains solutions to several first order partial differential equations (PDEs) using Mathematica. The PDEs include equations of the form x2 ∂u/∂x + y2 ∂u/∂y = (x+y)u, x ∂u/∂x + y ∂u/∂y = nu, and others. Mathematica's DSolve function is used to find the general solutions, which are then plotted over domains such as [-1,1]x[-1,1] to visualize the solutions.

Uploaded by

nidhikoshalia
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)
25 views

Practical - 4: First Order Partial Differential Equation

The document contains solutions to several first order partial differential equations (PDEs) using Mathematica. The PDEs include equations of the form x2 ∂u/∂x + y2 ∂u/∂y = (x+y)u, x ∂u/∂x + y ∂u/∂y = nu, and others. Mathematica's DSolve function is used to find the general solutions, which are then plotted over domains such as [-1,1]x[-1,1] to visualize the solutions.

Uploaded by

nidhikoshalia
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/ 6

PRACTICAL -4

First Order Partial Differential Equation


Ques. Solve the 1st order PDE x2 ∂∂ux + y2 ∂u
∂y
= (x+y)u

I n [ ] : = DSolvex2 * D[u[x, y], x] + y2 * D[u[x, y], y]  (x + y) * u[x, y], u[x, y], {x, y}
O u t [ ] =
1 1
u[x, y]  x y 1  - 
x y

∂u ∂u
Ques. Solve the 1 st order PDE x ∂x
+ y2 ∂y
= u

I n [ ] : = DSolve[x * D[u[x, y], x] + y * D[u[x, y], y]  u[x, y], u[x, y], {x, y}]
O u t [ ] =
y
u[x, y]  x 1  
x

∂u ∂u
Ques. Solve the 1 st order PDE x ∂x
+ y2 ∂y
= nu

I n [ ] : = DSolve[x * D[u[x, y], x] + y * D[u[x, y], y]  n * u[x, y], u[x, y], {x, y}]
O u t [ ] =
y
u[x, y]  xn 1  
x

Ques. Solve the PDE ux - u y = 1,


u ( x, 0) = x 2 and plot the solution overthe domain [- 1, 1] × [- 1, 1].
I n [ ] : = sol = DSolveD[u[x, y], x] - D[u[x, y], y]  1, u[x, 0]  x2 , u[x, y], {x, y}
O u t [ ] =

u[x, y]  x2 - y + 2 x y + y2 
2 NIDHI P4.nb

I n [ ] : = Plot3D[u[x, y] /. sol, {x, - 1, 1}, {y, - 1, 1}]


O u t [ ] =

I n [ ] : = ClearAll
O u t [ ] =

ClearAll

Ques. Solve the PDE yux - xu y = 0,


2
u (0, y ) = e- y and plot the solution overthe domain [- 1, 1] × [- 1, 1].
2
I n [ ] : = sol2 = DSolvey * D[u[x, y], x] + x * D[u[x, y], y]  0, u[0, y]  -y , u[x, y], {x, y}
O u t [ ] =
2
-y2
u[x, y]  x 

I n [ ] : = Plot3D[u[x, y] /. sol2, {x, - 1, 1}, {y, - 1, 1}]


O u t [ ] =

Ques. Solve the PDE xux - yu y = 2 xy,


u ( x, x 2) = 2 and plot the solution overthe domain [1, 2] × [- 2, 2].
NIDHI P4.nb 3

I n [ ] : = sol3 =
DSolvex * D[u[x, y], x] + y * D[u[x, y], y]  2 * x * y, ux, x2   2, u[x, y], {x, y}
O u t [ ] =

2 x 3 + x4 y - y 3
u[x, y]  
x3

I n [ ] : = Plot3D[u[x, y] /. sol3, {x, 1, 2}, {y, - 2, 2}]


O u t [ ] =

Ques. Solve the PDE ux + x u y = 0,


u (0, y ) = Siny and plot the solution overthe domain [- 5, 5] × [- 5, 5].
I n [ ] : = sol4 = DSolve[{D[u[x, y], x] + x * D[u[x, y], y]  0, u[0, y]  Sin[y]}, u[x, y], {x, y}]
O u t [ ] =

x2
u[x, y]  - Sin - y
2
4 NIDHI P4.nb

I n [ ] : = Plot3D[u[x, y] /. sol4, {x, - 5, 5}, {y, - 5, 5}]


O u t [ ] =

I n [ ] : = Plot[u[x, y] /. sol4 /. x  1, {y, - 5, 5}]


O u t [ ] =

1.0

0.5

-4 -2 2 4

-0.5

-1.0

I n [ ] : = Plot[u[x, y] /. sol4 /. y  1, {x, - 5, 5}]


O u t [ ] =

1.0

0.5

-4 -2 2 4

-0.5

-1.0

Ques. Solve the PDE ux + x u y =  y - 12 x 2 2 ,


u (0, y ) = e y and plot the solution overthe domain [- 2, 2] × [- 2, 2].
NIDHI P4.nb 5

I n [ ] : = sol5 =
1 2
DSolveD[u[x, y], x] + x * D[u[x, y], y]  y - x2 , u[0, y]  y , u[x, y], {x, y}
2
O u t [ ] =
1 x2 x2 x2 x2
4 y +  2 x5 - 4  2 x3 y + 4  2 x y2 
-
u[x, y]   2

I n [ ] : = Plot3D[u[x, y] /. sol5, {x, - 2, 2}, {y, - 2, 2}]


O u t [ ] =

I n [ ] : = ClearAll
O u t [ ] =

ClearAll

Ques. Solve the PDE uux - uu y = u 2 + ( x + y ) 2 ,


u ( x, 0) = 1 and plot the solution overthe domain [- 2, 2] × [- 2, 2].
I n [ ] : = sol6 = DSolveu[x, y] * D[u[x, y], x] - u[x, y] * D[u[x, y], y]  u2 + (x + y)2 , u[x, 0]  1,
u[x, y], {x, y}
O u t [ ] =

u[x, y]  - x2 - 2 x y - y2 + 2 x-2 (x+y) 1 + (x + y)2  


6 NIDHI P4.nb

I n [ ] : = Plot3D[u[x, y] /. sol6, {x, - 2, 2}, {y, - 2, 2}]


O u t [ ] =

I n [ ] : = ClearAll
O u t [ ] =

ClearAll

Ques. Solve the PDE ux + x u y = u + 1,


u ( x, x 2) = x 2 and plot the solution overthe domain [- 2, 2] × [- 2, 2].
I n [ ] : = sol7 =
DSolveD[u[x, y], x] + x * D[u[x, y], y]  u[x, y] + 1, ux, x2   x2 , u[x, y], {x, y}
O u t [ ] =
-x2 +2 y -x2 +2 y -x2 +2 y
u[x, y]  - 1 + x+ - x+ x2 + 2 x+ y

I n [ ] : = Plot3D[u[x, y] /. sol7, {x, - 2, 2}, {y, 1, 5}]


O u t [ ] =

You might also like