unable to solve with respect to y

1 view (last 30 days)
Juanita Rout
Juanita Rout on 6 May 2021
Answered: Star Strider on 6 May 2021
Did you mean:
>> ode=(x^2*diff(y,x,2))-(3*x*diff(y,x,1))+(3*y)==(2*x^4(exp^x))
ode=(x^2*diff(y,x,2))-(3*x*diff(y,x,1))+(3*y)==(2*x^4(exp^x))

Answers (1)

Star Strider
Star Strider on 6 May 2021
Try this —
syms s x y(x) y0 Dy0 C1 C2
Dy = diff(y);
D2y = diff(Dy);
ode=(x^2*D2y)-(3*x*Dy)+(3*y)==(2*x^4*(exp(x)))
ode(x) = 
y(x,C1,C2) = dsolve(ode)
y(x, C1, C2) = 
figure
fplot(y(x, 1, 2), [0 1])
I will let you compare your code to my correcctions to understand the reason this version works.
(I believe is and is , however it is not possible to define them directly, for some reason.)

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!