دنبال کننده ها

۱۳۹۶ اسفند ۲۳, چهارشنبه

Get a second derivative with python

[ad_1]

we have the follow cell in jupyter kernel python3:



from sympy.interactive.printing import init_printing
from sympy.core.symbol import symbols
from sympy.geometry.util import idiff
init_printing(use_unicode=True)
x = symbols('x')
y = symbols('y')


then just run:



eq = x ** 2 - x * y + y ** 2 - 3
eqd1 = idiff(eq, y, x)
eqd1


we get the correct answer: 2x-y / x-2y



but if run the code:



eqd2 = idiff(eqd1, y, x)
eqd2


we get: x/y but the answer realy is: 18/(x-2y)² or 6(x²-xy+y²)/(x-2y)³



x/y and 18/(x-2y)² don't looks like a equal expression or factorial one of another



Someone can help? Thanks.



[ad_2]

لینک منبع