Ask Your Question
0

A simple problem related to symbolic calculation

asked 2015-05-30 14:15:05 +0100

Nownuri1 gravatar image

updated 2015-05-30 14:40:17 +0100

rws gravatar image

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 flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-05-30 14:37:30 +0100

rws gravatar image

updated 2015-05-30 16:34:08 +0100

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.

edit flag offensive delete link more

Comments

Thank you so much!

Nownuri1 gravatar imageNownuri1 ( 2015-05-30 14:49:58 +0100 )edit

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

Nownuri1 gravatar imageNownuri1 ( 2015-05-30 14:56:55 +0100 )edit

I added to the answer. HTH.

rws gravatar imagerws ( 2015-05-30 16:34:46 +0100 )edit

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

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

Seen: 364 times

Last updated: May 30 '15