Solwant to solve a 2nd ving a partial differential equation with textbook solution
09-15-2023, 08:56 AM
Post: #1
 Anthony The Koala Junior Member Posts: 34 Joined: Aug 2023
Solwant to solve a 2nd ving a partial differential equation with textbook solution
First I managed to solve a 2nd order ode using the symbolic letters as in:
desolve(∂(∂u/∂x)∂x+3*∂u/∂x=0,x,y)

Now want to solve a 2nd order partial differential equation, pde

My Reference for a textbook solution is from the book "Advanced Mathematics For Engineering Students", page 131.

In the textbook
The 2nd order pde is
∂2u/(∂x∂y) = 2x - y.

The general solution is:

u = x^2*y - 1/2*x*y^2 + F(x) + G(y)

Where:
F(x) = 2* sin(x) and
G(y) = 3*y^4- 5

Entering the pde in the Prime [/b][/align]n CAS mode:

b]desolve(∂(∂u/∂y)∂x+y-2*x=0,x,y,u)[/b]

[1/2*y]

It was not the textbook's answer.

Question: why didn't the output from the prime match the textbook answer?[b]

Thank you,
Anthony, Sydney
09-15-2023, 12:18 PM
Post: #2
 Albert Chan Senior Member Posts: 2,516 Joined: Jul 2018
RE: partial differential equation with textbook solution
(09-15-2023 08:56 AM)Anthony The Koala Wrote:  In the textbook
The 2nd order pde is
∂2u/(∂x∂y) = 2x - y.

The general solution is:

u = x^2*y - 1/2*x*y^2 + F(x) + G(y)

Where:
F(x) = 2* sin(x) and
G(y) = 3*y^4- 5

F(x) and G(y) can be any expression, that particular set is just for illustration.
diff(u, y, x), both F(x) and G(y) goes away, leaving just (2x - y)

From XCas manual, desolve(de, <x, y>), where x is variable, y is unknown.
desolve may not be able to handle more variables. (it has other limits, see manual)

We do this in steps (1 variable, 1 unknown). let w = diff(u,y)

Cas> desolve(diff(w, x) = (2*x - y), x, w)

-x*y + x^2 + G_0

Cas> desolve(diff(u, y) = (-x*y + x^2), y, u)
Cas> expand(Ans)

-1/2*x*y^2 + x^2*y + G_0

Or, we simplify integrate twice, to get u

Cas> int(int((2*x - y), x), y)

-1/2*x*y^2 + x^2*y

u = x^2*y - 1/2*x*y^2 + F(x) + G(y), same as textbook answer
09-16-2023, 01:56 AM
Post: #3
 Anthony The Koala Junior Member Posts: 34 Joined: Aug 2023
RE: Solwant to solve a 2nd ving a partial differential equation with textbook solution
Dear Mr Chan,
Thank you for the reply. It is a learning experience of the limitations of the Prime not being able to handle PDEs.

I tried your two-stage solution and it works.

I wanted to go deeper by breaking down the statement
desolve(diff(w, x) = (2*x - y), x, w)
and do
diff(w, x) = (2*x - y), x, w)
The display said
[diff(w,x)=2*x-y x w] [0=2*x-y x w]

I tried
b]diff(w, x) = (2*x - y))[/b]
The display said
[diff(w,x)=2*x-y] [0=2*x-y]

I know desolve solves an ode but need further idea of what the Ans within the desolve does with
[diff(w,x)=2*x-y x w] [0=2*x-y x w] ?
[/b]
Ref for the int command
http://www.wiki4hp.com/doku.php?id=prime...s_commands