derivation of a exponential function - python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

derivation of a exponential function - python

I'm still new at this and I am trying to code a derivative calculator using python but when I try to differentiate exponential functions, the answer is not correct. Here is my code. from __future__ import division from sympy import * x,t = symbols('x t') Enter equation of i: ') equation=input(' ') print(diff(equation,x))

18th Oct 2019, 4:39 PM
Ian Jamora
Ian Jamora - avatar
2 Answers
+ 1
See this code. It is working very well. Input: x*x Output: 2*x https://code.sololearn.com/cn0aB7ILHTNK/?ref=app
9th Feb 2020, 8:41 PM
Pedro H.J
Pedro H.J - avatar
0
Try this function. diff(exp(x**2), x) Read more about sympy here https://docs.sympy.org/latest/tutorial/calculus.html
9th Feb 2020, 8:35 PM
Pedro H.J
Pedro H.J - avatar