Reputation: 195
I have to integrate a function over a variable that contains the derivative of this variable.
I'm using jupyter and here is my code:
from sympy import *
m, p, g, a, t=symbols('m, p, g, a, t')
r=Function('r')
integrate((r*(p**2/(m**2*r**4)-2*a*g)-r(t).diff(t)**2*4*a**2*r)/(1+4*a**2*r**2),r)
r(t).diff(t)
is my clumsy way of attempting to write \dot{r}
.
I get the following error :
TypeError: unsupported operand type(s) for ** or pow(): 'UndefinedFunction' and 'int'
Any help would be very appreciated.
Upvotes: 1
Views: 118
Reputation: 17607
You need to have r(t)
instead of r
. Try the following: integrate((r(t)*(p**2/(m**2*r(t)**4)-2*a*g)-r(t).diff(t)**2*4*a**2*r(t))/(1+4*a**2*r(t)**2), r(t))
Upvotes: 1