Solving differential equation in series general solution
4 次查看(过去 30 天)
显示 更早的评论
I was trying to solve differential equation in series general solution of (x+1)y''-(2-x)y'+y=0 and typed command, but it is not showing the correct solution and it is showing like the photo. However, I have to make the general solution look like y = C1(1 - (1/2)x^2 - (1/6)x^3 + ...) + C2(x + x^2 - (1/4)x^4 + ...) and could you please type the command for this part?
syms y(x)
S = dsolve((x+1)*diff(y,2)-(2-x)*diff(y)+y==0, 'ExpansionPoint',0,'Order',8)
syms C1 C2
C1*S(1) + C2*S(2)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1324050/image.png)
Also, could you make any example of initial conditions like for example y(0)=2, y'(0) = 1. I think I am not sure how to put the initial value command because it is not working properly when I type for example command like this below. I appreciate it!
syms y(x)
S = dsolve((x+1)*diff(y,2)-(2-x)*diff(y)+y==0, 'ExpansionPoint',0,'Order',8, y(0)==2, Dy(0)==1)
syms C1 C2
C1*S(1) + C2*S(2)
0 个评论
回答(1 个)
John D'Errico
2023-3-14
I just showed you how to solve the problem, for two unknown constants. Of course, your question here involves an initial value at x ==0. Becareful, as if the series is singular at x==0, then trying to solve for an initial condition at x==0 will fail.
Take the series solution, as I showed you how to formulate it. You can also differentiate it. Now, substitute x==0 into both the series, and the derivative of that series. Could you now use solve to compute the value of those undetermined coefficients?
3 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!