If I have two parametric equations, for example. x = 2*tand y = t**2 - 3, I can distinguish them as follows:
>>> x, y, t = symbols('x, y, t')
>>> x = 2*t
>>> y = t**2 - 3
>>> diff(y)/diff(x)
t
To get the second derivative:
>>> (diff(x,t,1)*diff(y,t,2) - diff(y,t,1)*diff(x,t,2)) / diff(x,t,1)**3
1/2
Is there a shortcut in sympy that I can use to calculate this?
Perhaps wrapping this in a function is what I should do?
>>> def second_derivative(x,y):
>>> return (diff(x,t,1)*diff(y,t,2) - diff(y,t,1)*diff(x,t,2)) / diff(x,t,1)**3
Then it becomes:
>>> second_derivative(2*t, t**2 - 3)
1/2