Sample question: How do I compute symbolic integrals like $\int{sin(x) tan(x)} dx$

i like this post (click again to cancel)
3
i dont like this post (click again to cancel)

(Sample question) How do I compute the integral of $sin(x) tan(x)$ in Sage?

asked Aug 18 '10

William Stein gravatar image William Stein
1414 5 20 46
http://wstein.org/

updated Oct 13 '10

Evgeny gravatar image Evgeny
51 1 4 11

5 Answers:

i like this answer (click again to cancel)
6
i dont like this answer (click again to cancel) William Stein has selected this answer as correct

First, make sure that you variable "x" is defined to be a symbolic variable:

sage: var('x')

then you can use the integrate command:

sage: integrate(sin(x)*tan(x), x)
-1/2*log(sin(x) - 1) + 1/2*log(sin(x) + 1) - sin(x)
link

posted Aug 18 '10

schilly gravatar image schilly
277 4 5 10

updated Aug 18 '10

i like this answer (click again to cancel)
5
i dont like this answer (click again to cancel)

In addition, symbolic functions have an integrate method. For example, given the function $f(x) = \sin(x)\tan(x)$,

sage: var('x')
sage: f = sin(x)*tan(x)

its symbolic integral is calculated like so:

sage: f.integrate(x)
-1/2*log(sin(x) - 1) + 1/2*log(sin(x) + 1) - sin(x)

Be sure to provide the variable you wish to integrate with respect to as an argument to integrate.

link

posted Aug 18 '10

cswiercz gravatar image cswiercz
839 6 17 33
http://www.cswiercz.info/

updated Oct 13 '10

Evgeny gravatar image Evgeny
51 1 4 11
i like this answer (click again to cancel)
3
i dont like this answer (click again to cancel)

You can integrate sin(x)*tan(x) in Sage by using the integrate command:

sage: integrate(sin(x)*tan(x), x)
-1/2*log(sin(x) - 1) + 1/2*log(sin(x) + 1) - sin(x)

You can find some more examples in the tutorial.

link

posted Aug 18 '10

Mike Hansen gravatar image Mike Hansen flag of United States
3890 23 46 84
Thankx for the link to the tutorial ;) schilly (Aug 18 '10)
i like this answer (click again to cancel)
0
i dont like this answer (click again to cancel)

Sample answer: does TeX work, I wonder... $\int_0^{\infty} e^{-t^2} dt$

link

posted Aug 18 '10

Dima gravatar image Dima
246 2 9
No jsmath yet. We need to add it like on mathoverflow.net. William Stein (Aug 18 '10)
well, if it is mathjax by default, formulas are inside \( \) or $$ $$. just a single $ is a bad idea ^^ schilly (Aug 18 '10)
single $ is used for inline tex, double for block-style. Evgeny (Oct 13 '10)
i like this answer (click again to cancel)
0
i dont like this answer (click again to cancel)

$\sum 2$ great

:-) like that !!

can you get (integrate) this (live-preview) functionality into the sage notebook text editor (tiny-mce) somehow ?

i'd like to see the formula there while typing

if i double-click directly on a formula tinymce opens plus a box with latex source code. but only the first time. how about the box popping up each time i place the cursor into a latex formula and then showing the typeset math. at the moment i don't see the use of the box ...

thanks for sage ... am loving it!!!

regards

Patrick


I guess, I am asking in the wrong place - (maybe "mis-")using this forum as a scratch pad - but the suggestion I'm making is somehow connected with this ... (I reached here from a blog bost).

So to be a bit more precise:

I am actually talking about the sage notebook. I am wondering what this light grey window is really good for and suggesting an way to make use of it.

link

posted Nov 02 '10

Patrick2000 gravatar image Patrick2000
1 1

updated Nov 03 '10

do you mean - how to access latex source for the equation here in this forum? Mouse over the formula and right-click. Then select "Show source". Evgeny (Nov 02 '10)
Ehr - no - although that's also a real nice functionality i didn't know of (fancy menu shades! (but menu initially hidden under firefox default menu (ubuntu 10.04 - 64bit : http://oi56.tinypic.com/1hef4p.jpg))) Patrick2000 (Nov 03 '10)

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
Login/Signup to Post

Question tools

1 follower

Tags:

Stats:

Asked: Aug 18 '10

Seen: 837 times

Last updated: Nov 03 '10

powered by ASKBOT version 0.7.22
Copyright Sage, 2010. Some rights reserved under creative commons license.