Ask Your Question

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

asked 2010-08-18 19:35:19 +0200

William Stein gravatar image

updated 2010-10-13 21:39:00 +0200

Evgeny gravatar image

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

edit retag flag offensive close merge delete

5 Answers

Sort by ยป oldest newest most voted

answered 2010-08-18 19:42:22 +0200

schilly gravatar image

updated 2010-08-18 19:43:29 +0200

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)
edit flag offensive delete link more

answered 2010-08-18 19:50:37 +0200

updated 2010-10-13 21:35:59 +0200

Evgeny gravatar image

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.

edit flag offensive delete link more

answered 2010-08-18 19:41:34 +0200

Mike Hansen gravatar image

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.

edit flag offensive delete link more


Thankx for the link to the tutorial ;)

schilly gravatar imageschilly ( 2010-08-18 19:43:06 +0200 )edit

answered 2010-08-18 19:40:10 +0200

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

edit flag offensive delete link more


No jsmath yet. We need to add it like on

William Stein gravatar imageWilliam Stein ( 2010-08-18 19:48:10 +0200 )edit

well, if it is mathjax by default, formulas are inside \( \) or $$ $$. just a single $ is a bad idea ^^

schilly gravatar imageschilly ( 2010-08-18 19:53:23 +0200 )edit

single $ is used for inline tex, double for block-style.

Evgeny gravatar imageEvgeny ( 2010-10-13 21:35:31 +0200 )edit

answered 2010-11-02 18:37:32 +0200

Patrick2000 gravatar image

updated 2010-11-03 16:13:51 +0200

$\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!!!



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.

edit flag offensive delete link more


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 gravatar imageEvgeny ( 2010-11-02 18:45:36 +0200 )edit

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 :

Patrick2000 gravatar imagePatrick2000 ( 2010-11-03 16:35:56 +0200 )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


Asked: 2010-08-18 19:35:19 +0200

Seen: 2,258 times

Last updated: Nov 03 '10