I want to differentiate the following equation
from sympy import *
init_printing()
x, t, r, phi = symbols('x, t, r, phi')
# this is how I want to do it
eq = Eq(x(t), r*phi(t))
eq.diff(t)
The result is differentiated only on the left side. I would like it to be evaluated on both sides. Is that possible in a simple way?
Currently I do the following:
Eq(eq.lhs.diff(t), eq.rhs.diff(t))
In implicit differentiation, we differentiate each side of an equation with two variables (usually x and y) by treating one of the variables as a function of the other. This calls for using the chain rule. Let's differentiate x 2 + y 2 = 1 x^2+y^2=1 x2+y2=1x, squared, plus, y, squared, equals, 1 for example.
In order to differentiate a function of a function, y = f(g(x)), that is to find dy dx , we need to do two things: 1. Substitute u = g(x). This gives us y = f(u) Next we need to use a formula that is known as the Chain Rule.
The instantaneous rate of change of a function with respect to another quantity is called differentiation. For example, speed is the rate of change of displacement at a certain time.
Borrowing some of the logic from Sympy: working with equalities manually, you can do something like this:
eq.func(*map(lambda x: diff(x, t), eq.args))
A bit ugly, but it works. Alternatively, you could just lift the .do()
method from that and use it if you're going to want to do this a bunch of times.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With