Message Boards Message Boards

0
|
6796 Views
|
10 Replies
|
7 Total Likes
View groups...
Share
Share this post:

Integrate a trigonometric function with three constants a, b, c?

$$ \int_{N-\pi}^{N} \sqrt {a + (b Sin\theta + c Cos \theta)^2} d\theta $$ enter image description here

POSTED BY: Tanmaya Mishra
10 Replies

I tried the integral using Rubi in Mathematica (see Rubi page for Mathematica installation. While it did not work any better than MMA's Integrate, I reported it to the Rubi team and they added Gianluca's substitution to Rubi. The response from Albert Rich was (Full thread is here)

@ackinetics Thanks for reminding me of the identity I derived a while back:

_

aSin[z] + bCos[z] == Sqrt[a^2 + b^2]*Sin[z + ArcTan[a, b]] which is valid for all a, b and z throughout the complex plane. The next version of Rubi will use this identity so

_

Int[Sqrt[a + (b*Sin[x] + c Cos[x])^2], x] will evaluate to

_

Sqrt[a]*EllipticE[x + ArcTan[b, c], -(b^2 + c^2)/a] if a>0, and if not to

_

(Sqrt[a + (cCos[x] + bSin[x])^2]/Sqrt[(a + (c*Cos[x] + bSin[x])^2)/a]) EllipticE[x + ArcTan[b, c], -(b^2 + c^2)/a] This will make the original definite integral problem in the Wolfram Community thread

_

Int[Sqrt[a + (b*Sin[x] + c Cos[x])^2], {x, n - Pi, n}] trivial for the next version of Rubi.

Thanks again, Albert

POSTED BY: Neil Singer

Excellent news ,Thanks.

Regards MI.

POSTED BY: Mariusz Iwaniuk

Find constants r, z such that

b Sin[\[Theta]] + c Cos[\[Theta]] == r Sin[\[Theta] + z]

and change integration variable to t == \[Theta] + z. The integral will become a clean elliptic integral.

POSTED BY: Gianluca Gorni

@Gianluca, I am getting an answer in elliptic function from Mathematica.

enter image description here

How to do the post processing? Thanks Tanmaya!

POSTED BY: Tanmaya Mishra

Using equation 2 form here:

 sol = Integrate[Sqrt[a + (r*Sin[x + z])^2], {x, n - Pi, n},  Assumptions -> {a > 0, r > 0, z > 0, n > 0}] /. 
 r -> Sqrt[b^2 + c^2] /. z -> ArcTan[b, c]
 (* Sqrt[a] (EllipticE[n + ArcTan[b, c], -((b^2 + c^2)/a)] - EllipticE[n - \[Pi] + ArcTan[b, c], -((b^2 + c^2)/a)]) *)

 a = 1;(*Assumed constans*)
 b = 1;
 c = 2;
 n = 10;
 sol // N // Chop
 (* 5.6604 *)

Answer is the same if I use NIntegrate.

POSTED BY: Mariusz Iwaniuk

This one can be integrated, but Mathematica's answer needs some post-processing to remove the discontinuities.

POSTED BY: Gianluca Gorni

the fact that all functions can be differentiated does not imply that all functions can be integrated.

POSTED BY: Frank Kampas

You can compute a symbolic primitive very quickly

f[\[Theta]_] = 
 Integrate[Sqrt[a + (b Sin[\[Theta]] + c Cos[\[Theta]])^2], \[Theta]]

but then beware that it has jump discontinuities.

POSTED BY: Gianluca Gorni

For general $a,b,c$ symbolic solver Integrate returns unevaluated, then Mathematica can't solve the problem.

  Integrate[Sqrt[a + (b*Sin[x] + c Cos[x])^2], {x, n - Pi, n}, Assumptions -> {a > 0, b > 0, c > 0, n > 0}]
  (* Input *)

Mathematica only can compute if $c = b$:

Integrate[Sqrt[a + (b*Sin[x] + b*Cos[x])^2] // Simplify, {x, n - Pi, n}, Assumptions -> {a > 0, b > 0, n > 0}]
(* Sqrt[a + 2 b^2] (-EllipticE[n - (5 \[Pi])/4, (2 b^2)/(a + 2 b^2)] + EllipticE[n - \[Pi]/4, (2 b^2)/(a + 2 b^2)]) *)

But, we can compute numerically:

 f[a_, b_, c_, n_] := NIntegrate[Sqrt[a + (b*Sin[x] + c Cos[x])^2], {x, n - Pi, n}]

  a=1; (*Assumed constans*)
  b=1;
  c=2;
  n=10;
  f[a,b,c,n]
  (*   5.6604   *)
POSTED BY: Mariusz Iwaniuk

Thanks. But i wanted a symbolic integration of the fiction (not numeric).

POSTED BY: Tanmaya Mishra
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract