I have the function $f(x,y,y')= \sqrt{1+y'(x)^2}$ from which I want to calculate $\frac{\partial f}{\partial y}$ as well as $\frac{\partial f}{\partial y'}$ and $\frac{d}{dx}\left(\frac{\partial f}{\partial y'}\right)$.
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 $\frac{df}{dx}$. 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)
fxy1 = fy1.diff(x)
which works for calculating $\frac{\partial f}{\partial y}$ and $\frac{\partial f}{\partial y'}$, but not for $\frac{d}{dx}\left(\frac{\partial f}{\partial y'}\right)$. Because fxy1 returns 0 when it should return $\frac{y''}{\sqrt{1+y'(x)^2}^{3/2}}$.
I'd really appreciate any idea. Thanks in advance!