Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I'm using Sage to calculate a curve arc length.

Basically, the curve is given by this equation:

enter image description here

In sage, I'm calculating it's arc length by using this formula:

integral(sqrt((derivative(t - sin(t)))^2 + (derivative(1 - cos(t)))^2 + (derivative(4 * cos(t/2)))^2), t, 0, 8*pi); 

The formula is from here: http://www.mathwords.com/a/arc_length_of_a_curve.htm

Basically, it should return

32 * sqrt(2)

but it always returns 0.

Could anyone tell me why? I probably did something wrong with the syntax, but can't figure out where.

share|improve this question
I deleted my answer because it is indeed a branch problem and not a syntax problem. –  Phira May 20 '12 at 23:13
var('t'); f = sqrt(sin(t)^2); integral(f,t,0,2*pi) <-- this throws an error, asking for an assumption on the sign of sin(t). If assume(sin(t)>0) is added [though false], the answer is 0. As much as I like open-source software, I guess the message is to look elsewhere when you need symbolic integration. –  user31373 May 20 '12 at 23:18

1 Answer 1

up vote 2 down vote accepted

Probably Sage did not keep track of branches, and used a discontinuous anti-derivative. Maple, also, has a discontinuous anti-derivative. But Maple manages to take the jumps into account and gets the right answer. $$ \begin{align} &\int 2 \sqrt{2} \mathrm{sgn} \Biggl(\operatorname{sin} \biggl(\frac{t}{2}\biggr)\Biggr) \operatorname{sin} \biggl(\frac{t}{2}\biggr) d t = -4\sqrt{2} \mathrm{sgn} \Biggl(\operatorname{sin} \biggl(\frac{t}{2}\biggr)\Biggr) \operatorname{cos} \biggl(\frac{t}{2}\biggr) \\ &\int_{0}^{8 \pi} 2 \sqrt{2} \mathrm{sgn} \Biggl(\operatorname{sin} \biggl(\frac{t}{2}\biggr)\Biggr) \operatorname{sin} \biggl(\frac{t}{2}\biggr) d t = 32 \sqrt{2} \end{align} $$

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.