Samik Prakash
Samik Prakash

Reputation: 17

SymPy diff function on cosec(x) is returning Derivative(cosec(x),x)

Here is the code that I wrote:

print(diff("cosec(x)","x"))

The output I got is: Derivative(cosec(x), x)

What is up with this and how do I actually get the derivative of cosec(x)?

Upvotes: 0

Views: 158

Answers (1)

enzotib
enzotib

Reputation: 1644

You should define the symbol x:

x = Symbol('x')

then you can obtain the derivative as

diff(csc(x),x)

As you can see the name of cosecant function is csc

Upvotes: 1

Related Questions