Apr-12-2019, 11:32 AM
Hello, I have some trouble trying to define a function using the math module to write a logarithm and then derivating it in python 2.7.
I want to write the function xo=log(yo) and then being able to derivate it to obatin as output 1/yo.
Here's the code:
I want to write the function xo=log(yo) and then being able to derivate it to obatin as output 1/yo.
Here's the code:
from math import * from sympy import * xo,yo,zo=symbols('xo yo zo', real=True) xo=log(yo) dyo1=diff(xo, yo) print ("dxo/dyo="),dyo1When I execute the programme I get this error in line 5:
Error:xo=log(yo)
AttributeError: 'Symbol' object has no attribute 'log'