Please 🙏 help me to find the exact solution of ODE

I want to find the exact solution of ODE .The delta1 and delta2 are constants. y^2 y''+y*(y')^2-(y')^2+C1*y^4+C2*y^3=0

1 Comment

Hi @Tarek, could you provide some background on the ODE ?
Where does this ODE originate?
Why is it necessary to determine and ?
And, once and are found, what do you expect to happen with the state variable y?

Sign in to comment.

 Accepted Answer

Torsten
Torsten on 27 Jul 2025
Edited: Torsten on 27 Jul 2025
I doubt you can get an analytical expression for y. All you can do is to transform your 2nd order ODE into a system of first-order ODEs and use a numerical solver to get an approximate solution. Depending on your boundary conditions, you have to use ode45 (if all boundary conditions are given in only one point) or bvp4c (if the boundary conditions are given in different points) to get this solution. Of course, C1 and C2 and the boundary conditions have to be specified as numerical values in this case.

9 Comments

Thank you very much @ Torsten. Finally,i would to find the best value of constant C1 and C2 in the ODE with anycode or any function??

What do you mean by "best value" ?
Do you have data for y and you want to fit C1 and C2 such that the distance between your data and y is as small as possible ?
And now ? I don't know your data and I don't know your boundary conditions...

ODE

y^2 y''+y*(y')^2-(y')^2+C1*y^4+C2*y^3=0

B.C Y(x=-any value)=0. Y(x=+any value)=0

Torsten
Torsten on 27 Jul 2025
Edited: Torsten on 27 Jul 2025
y identically 0 is the solution you will get from every numerical solver. I don't know if other solutions exist for the boundary conditions you gave.
Hi @Tarek,
Could you try the following approach to determine whether it is the analytical solution that yields the desired contant results whenever the initial condition is specified?
syms C1 C2 y(x) c
dy = diff(y);
d2y = diff(dy);
% differential equation
eqn = y^2 * d2y + y*dy^2 - dy^2 + C1*y^4 + C2*y^3 == 0
eqn(x) = 
% intelligently guess the values for C1 and C2
eqn = subs(eqn, [C1, C2], [0, 0])
eqn(x) = 
% initial condition
cond = [y(0)==c, dy(0)==0];
% solution
ySol(x) = dsolve(eqn, cond)
ySol(x) = 
c

Hi @Sam, thank you for your helping.

Does the obtained y is the exact solution for ode??

Each trajectory in the plot represents the path of a solution to the differential equation, depending on the values of ​ and ​. In my previous comment, I provided the simplest form of the solution, which corresponds to the specific initial condition when both ​ and ​​ are zero. Note that singularities occur when .
title(t, {'Behavior of solutions'}, 'interpreter', 'latex')

Sign in to comment.

More Answers (1)

syms C1 C2 y(x)
dy = diff(y);
d2y = diff(dy);
eqn = y^2 * d2y + y*dy^2 - dy^2 + C1*y^4 + C2*y^3 == 0
eqn(x) = 
dsolve(eqn)
ans = 

2 Comments

 Thanks for your help.

what the values of constant c1 and c2 from the last condition?

C1 and C2 are the values from your own ODE
y^2 y''+y*(y')^2-(y')^2+C1*y^4+C2*y^3=0
and they will of course appear in a solution.
C3 and C4 are constants that arise from integrating your ODE without specifying two boundary conditions.
Example:
y'' = 5
has the general solution
y(x) = 2.5*x^2 + C3*x + C4

Sign in to comment.

Products

Tags

Asked:

on 27 Jul 2025

Commented:

on 29 Jul 2025

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!