How to use matlab to solve the expression of w with respect to x?

5 views (last 30 days)

Accepted Answer

Walter Roberson
Walter Roberson on 16 May 2023
syms w(x)
syms c real
dw = diff(w); d2w = diff(dw);
eqn = d2w/(1+dw^2)^(3/2) == c*x
eqn(x) = 
sol = dsolve(eqn)
sol = 
The integrals are possibly not expressable in closed form solutions.
  5 Comments
Walter Roberson
Walter Roberson on 16 May 2023
R2022a:
>> syms w(x)
syms c real
dw = diff(w); d2w = diff(dw);
eqn = d2w/(1+dw^2)^(3/2) == c*x
sol = dsolve(eqn)
eqn(x) =
diff(w(x), x, x)/(diff(w(x), x)^2 + 1)^(3/2) == c*x
sol =
C2 + int(((-(c*x^2 + 2*C1 - 2)*(c*x^2 + 2*C1 + 2))^(1/2)*(c*x^2 + 2*C1))/(4*C1^2 + 4*C1*c*x^2 + c^2*x^4 - 4), x, 'IgnoreSpecialCases', true, 'IgnoreAnalyticConstraints', true)
C3 + int((c*x^2 + 2*C1)/(- 4*C1^2 - 4*C1*c*x^2 - c^2*x^4 + 4)^(1/2), x, 'IgnoreSpecialCases', true, 'IgnoreAnalyticConstraints', true)
So I do not know what you are seeing that leads you to think that the R2022* versions are unable to solve this the same way as the current version.
Those are two solutions. not a sum. You can access sol(1) and sol(2)
loyal
loyal on 16 May 2023
Sorry, I mean versions younger than 2022 will not work。It solved Thank you so much! Have a good day

Sign in to comment.

More Answers (0)

Categories

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

Community Treasure Hunt

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

Start Hunting!