solving the differential equation

2 次查看(过去 30 天)
Hi.
I have a differential equation of a function f(x,y) wrt "x". I can solve this equation using the "dsolve" and obtain the solution. Now I again want to differentiate the solution obtained wrt to other variable "y". Can anyone please help me in writing the code for differentiating the solution thus obtained. Here is the code attached:
syms f(x) y
ode = diff(f,x) == -(2/x)*f + (4*x^3*y^2 + 2*x*y + 6*x)/x^2;
sol = dsolve(ode);
%-------------------------------------------------%
val =
C3/x^2 + (x^2*(y + 3) + x^4*y^2)/x^2
In this code, I want to differentiate the "sol" wrt variable "y". Note that the constant "C3" in the solution is a function of "x & y".
  5 个评论
Walter Roberson
Walter Roberson 2021-12-15
syms f(x,y)
ode = diff(f,x) + diff(f,y) + (2/x)*f == (4*x^3*y^2 + 2*x*y + 6*x)/x^2 + 2*x^2*y + 1
ode(x, y) = 
Walter Roberson
Walter Roberson 2021-12-15
syms f(x) y C(y)
ode = diff(f,x) == -(2/x)*f + (4*x^3*y^2 + 2*x*y + 6*x)/x^2;
sol = simplify(expand((dsolve(ode))))
sol = 
vars = symvar(sol);
soly = subs(sol, vars(1), C)
soly = 
Dsoly = diff(soly,y)
Dsoly = 

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Calculus 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by