Ask Your Question

# A simple problem related to symbolic calculation

Could anyone let me know how you can define a variable as some function of another variable without specific definition? For example, how can you define theta as some function of x and then differentiate the 'sin(theta)' by x?

The following is my code that doesn't work. I couldn't find how to fix it in reference manuals. Any help will be appreciated.

var('theta, y, f')

y=sin(theta) ; theta=f(x);

y.derivative(x)

edit retag close merge delete

## 1 Answer

Sort by ยป oldest newest most voted
sage: theta = function('theta')(x)
sage: y = sin(theta)
sage: y.diff(x)
cos(theta(x))*D[0](theta)(x)


Dis the differential operator, see https://en.wikipedia.org/wiki/Differe.... The online Sage docs are a bit behind the newest development version, so I cannot give you a link to Sage docs at the moment.

more

## Comments

Thank you so much!

( 2015-05-30 14:49:58 +0200 )edit

But could you please tell me what the D[0] (theta) (x) means?

( 2015-05-30 14:56:55 +0200 )edit

I added to the answer. HTH.

( 2015-05-30 16:34:46 +0200 )edit

## Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

## Stats

Asked: 2015-05-30 14:15:05 +0200

Seen: 280 times

Last updated: May 30 '15