partial derivatives
I have the function f(x,y,y′)=√1+y′(x)2 from which I want to calculate ∂f∂y as well as ∂f∂y′ and ddx(∂f∂y′).
I tried using the SymbolicRing of Sagemath with
x = SR.var('x')
y = function('y')
f = sqrt(1+y(x).diff(x,1)^2)
which only allows me to calculate dfdx. So I tried with the following sample
x,y = SR.var('x,y')
y = function('y')(x)
y1 = y.diff(x,1)
f(x,y,y1) = sqrt(1+y1^2)
fy1 = f.diff(y1)
fy = f.diff(y)
dxfy1 = fy1.diff(x)
which works for calculating ∂f∂y and ∂f∂y′, but not for ddx(∂f∂y′). Because dxfy1 which stands for ddx(∂f∂y′) returns 0 when it should return y″√1+y′(x)23/2.
Another unseccesful try would be
x,y = SR.var('x,y')
y = function('y')(x)
y1 = y.diff(x,1)
y1=function('y1')(x)
f(x,y,y1) = sqrt(1+y.diff(x)^2)
fy1(x,y,y1) = f.diff(y1); fy1
fy(x,y,y1) = f.diff(y); fy
fy1.diff(x)
I'd really appreciate any idea. Thanks in advance!
is y′ a notation for dydx ?
Nver mind : your code anwered for you.
Yes, y′ stand for dydx. @Emmanuel Charpentier