How can i get output?

12 views (last 30 days)
세빈 김
세빈 김 on 15 Apr 2022
Answered: charan on 27 Sep 2023
>> syms y(x)
ode=diff(y,x)==x-1/y
ode(x) =
diff(y(x), x) == x - 1/y(x)
>> ySol(x)=dsolve(ode)
경고: 기호 해를 구할 수 없습니다.
> dsolve (209번 라인)번 라인에서
ySol(x) =
[ empty sym ]
how can i get the answer of "ySol(x)="?

Answers (1)

charan
charan on 27 Sep 2023
Hello,
I understand that you are trying to solve a differential equation using “dsolve” but you are getting an empty sym.
This is because the system you have provided has no solution. If you are expecting a solution, then maybe your equation missed a bracket and is (instead of x-1/y) as follows:
eqn=diff(y,x)==(x-1)/y;
This equation has solutions, and they are:
ySol(x) =
(x^2 - 2*x + C1)^(1/2)
-(x^2 - 2*x + C1)^(1/2)
You can refer to the below documentation to learn more about “dsolve”:
Thanks,
Charan

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!