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 *)
Thanks. But i wanted a symbolic integration of the fiction (not numeric).
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.
the fact that all functions can be differentiated does not imply that all functions can be integrated.
This one can be integrated, but Mathematica’s answer needs some post-processing to remove the discontinuities.
@Gianluca,
I am getting an answer in elliptic function from Mathematica.
How to do the post processing?
Thanks
Tanmaya!
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.
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.
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 + (cCos[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
Excellent news ,Thanks.
Regards MI.

