3.47 \(\int \frac{\cos (a+b x)}{c+d x+e x^2} \, dx\)

Optimal. Leaf size=271 \[ \frac{\cos \left (a-\frac{b \left (d-\sqrt{d^2-4 c e}\right )}{2 e}\right ) \text{CosIntegral}\left (\frac{b \left (d-\sqrt{d^2-4 c e}\right )}{2 e}+b x\right )}{\sqrt{d^2-4 c e}}-\frac{\cos \left (a-\frac{b \left (\sqrt{d^2-4 c e}+d\right )}{2 e}\right ) \text{CosIntegral}\left (\frac{b \left (\sqrt{d^2-4 c e}+d\right )}{2 e}+b x\right )}{\sqrt{d^2-4 c e}}-\frac{\sin \left (a-\frac{b \left (d-\sqrt{d^2-4 c e}\right )}{2 e}\right ) \text{Si}\left (\frac{b \left (d-\sqrt{d^2-4 c e}\right )}{2 e}+b x\right )}{\sqrt{d^2-4 c e}}+\frac{\sin \left (a-\frac{b \left (\sqrt{d^2-4 c e}+d\right )}{2 e}\right ) \text{Si}\left (\frac{b \left (d+\sqrt{d^2-4 c e}\right )}{2 e}+b x\right )}{\sqrt{d^2-4 c e}} \]

[Out]

(Cos[a - (b*(d - Sqrt[d^2 - 4*c*e]))/(2*e)]*CosIntegral[(b*(d - Sqrt[d^2 - 4*c*e]))/(2*e) + b*x])/Sqrt[d^2 - 4
*c*e] - (Cos[a - (b*(d + Sqrt[d^2 - 4*c*e]))/(2*e)]*CosIntegral[(b*(d + Sqrt[d^2 - 4*c*e]))/(2*e) + b*x])/Sqrt
[d^2 - 4*c*e] - (Sin[a - (b*(d - Sqrt[d^2 - 4*c*e]))/(2*e)]*SinIntegral[(b*(d - Sqrt[d^2 - 4*c*e]))/(2*e) + b*
x])/Sqrt[d^2 - 4*c*e] + (Sin[a - (b*(d + Sqrt[d^2 - 4*c*e]))/(2*e)]*SinIntegral[(b*(d + Sqrt[d^2 - 4*c*e]))/(2
*e) + b*x])/Sqrt[d^2 - 4*c*e]

________________________________________________________________________________________

Rubi [A]  time = 0.56233, antiderivative size = 271, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 4, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.21, Rules used = {6728, 3303, 3299, 3302} \[ \frac{\cos \left (a-\frac{b \left (d-\sqrt{d^2-4 c e}\right )}{2 e}\right ) \text{CosIntegral}\left (\frac{b \left (d-\sqrt{d^2-4 c e}\right )}{2 e}+b x\right )}{\sqrt{d^2-4 c e}}-\frac{\cos \left (a-\frac{b \left (\sqrt{d^2-4 c e}+d\right )}{2 e}\right ) \text{CosIntegral}\left (\frac{b \left (\sqrt{d^2-4 c e}+d\right )}{2 e}+b x\right )}{\sqrt{d^2-4 c e}}-\frac{\sin \left (a-\frac{b \left (d-\sqrt{d^2-4 c e}\right )}{2 e}\right ) \text{Si}\left (\frac{b \left (d-\sqrt{d^2-4 c e}\right )}{2 e}+b x\right )}{\sqrt{d^2-4 c e}}+\frac{\sin \left (a-\frac{b \left (\sqrt{d^2-4 c e}+d\right )}{2 e}\right ) \text{Si}\left (\frac{b \left (d+\sqrt{d^2-4 c e}\right )}{2 e}+b x\right )}{\sqrt{d^2-4 c e}} \]

Antiderivative was successfully verified.

[In]

Int[Cos[a + b*x]/(c + d*x + e*x^2),x]

[Out]

(Cos[a - (b*(d - Sqrt[d^2 - 4*c*e]))/(2*e)]*CosIntegral[(b*(d - Sqrt[d^2 - 4*c*e]))/(2*e) + b*x])/Sqrt[d^2 - 4
*c*e] - (Cos[a - (b*(d + Sqrt[d^2 - 4*c*e]))/(2*e)]*CosIntegral[(b*(d + Sqrt[d^2 - 4*c*e]))/(2*e) + b*x])/Sqrt
[d^2 - 4*c*e] - (Sin[a - (b*(d - Sqrt[d^2 - 4*c*e]))/(2*e)]*SinIntegral[(b*(d - Sqrt[d^2 - 4*c*e]))/(2*e) + b*
x])/Sqrt[d^2 - 4*c*e] + (Sin[a - (b*(d + Sqrt[d^2 - 4*c*e]))/(2*e)]*SinIntegral[(b*(d + Sqrt[d^2 - 4*c*e]))/(2
*e) + b*x])/Sqrt[d^2 - 4*c*e]

Rule 6728

Int[(u_)/((a_.) + (b_.)*(x_)^(n_.) + (c_.)*(x_)^(n2_.)), x_Symbol] :> With[{v = RationalFunctionExpand[u/(a +
b*x^n + c*x^(2*n)), x]}, Int[v, x] /; SumQ[v]] /; FreeQ[{a, b, c}, x] && EqQ[n2, 2*n] && IGtQ[n, 0]

Rule 3303

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Dist[Cos[(d*e - c*f)/d], Int[Sin[(c*f)/d + f*x]
/(c + d*x), x], x] + Dist[Sin[(d*e - c*f)/d], Int[Cos[(c*f)/d + f*x]/(c + d*x), x], x] /; FreeQ[{c, d, e, f},
x] && NeQ[d*e - c*f, 0]

Rule 3299

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[SinIntegral[e + f*x]/d, x] /; FreeQ[{c, d,
 e, f}, x] && EqQ[d*e - c*f, 0]

Rule 3302

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[CosIntegral[e - Pi/2 + f*x]/d, x] /; FreeQ
[{c, d, e, f}, x] && EqQ[d*(e - Pi/2) - c*f, 0]

Rubi steps

\begin{align*} \int \frac{\cos (a+b x)}{c+d x+e x^2} \, dx &=\int \left (\frac{2 e \cos (a+b x)}{\sqrt{d^2-4 c e} \left (d-\sqrt{d^2-4 c e}+2 e x\right )}-\frac{2 e \cos (a+b x)}{\sqrt{d^2-4 c e} \left (d+\sqrt{d^2-4 c e}+2 e x\right )}\right ) \, dx\\ &=\frac{(2 e) \int \frac{\cos (a+b x)}{d-\sqrt{d^2-4 c e}+2 e x} \, dx}{\sqrt{d^2-4 c e}}-\frac{(2 e) \int \frac{\cos (a+b x)}{d+\sqrt{d^2-4 c e}+2 e x} \, dx}{\sqrt{d^2-4 c e}}\\ &=\frac{\left (2 e \cos \left (a-\frac{b \left (d-\sqrt{d^2-4 c e}\right )}{2 e}\right )\right ) \int \frac{\cos \left (\frac{b \left (d-\sqrt{d^2-4 c e}\right )}{2 e}+b x\right )}{d-\sqrt{d^2-4 c e}+2 e x} \, dx}{\sqrt{d^2-4 c e}}-\frac{\left (2 e \cos \left (a-\frac{b \left (d+\sqrt{d^2-4 c e}\right )}{2 e}\right )\right ) \int \frac{\cos \left (\frac{b \left (d+\sqrt{d^2-4 c e}\right )}{2 e}+b x\right )}{d+\sqrt{d^2-4 c e}+2 e x} \, dx}{\sqrt{d^2-4 c e}}-\frac{\left (2 e \sin \left (a-\frac{b \left (d-\sqrt{d^2-4 c e}\right )}{2 e}\right )\right ) \int \frac{\sin \left (\frac{b \left (d-\sqrt{d^2-4 c e}\right )}{2 e}+b x\right )}{d-\sqrt{d^2-4 c e}+2 e x} \, dx}{\sqrt{d^2-4 c e}}+\frac{\left (2 e \sin \left (a-\frac{b \left (d+\sqrt{d^2-4 c e}\right )}{2 e}\right )\right ) \int \frac{\sin \left (\frac{b \left (d+\sqrt{d^2-4 c e}\right )}{2 e}+b x\right )}{d+\sqrt{d^2-4 c e}+2 e x} \, dx}{\sqrt{d^2-4 c e}}\\ &=\frac{\cos \left (a-\frac{b \left (d-\sqrt{d^2-4 c e}\right )}{2 e}\right ) \text{Ci}\left (\frac{b \left (d-\sqrt{d^2-4 c e}\right )}{2 e}+b x\right )}{\sqrt{d^2-4 c e}}-\frac{\cos \left (a-\frac{b \left (d+\sqrt{d^2-4 c e}\right )}{2 e}\right ) \text{Ci}\left (\frac{b \left (d+\sqrt{d^2-4 c e}\right )}{2 e}+b x\right )}{\sqrt{d^2-4 c e}}-\frac{\sin \left (a-\frac{b \left (d-\sqrt{d^2-4 c e}\right )}{2 e}\right ) \text{Si}\left (\frac{b \left (d-\sqrt{d^2-4 c e}\right )}{2 e}+b x\right )}{\sqrt{d^2-4 c e}}+\frac{\sin \left (a-\frac{b \left (d+\sqrt{d^2-4 c e}\right )}{2 e}\right ) \text{Si}\left (\frac{b \left (d+\sqrt{d^2-4 c e}\right )}{2 e}+b x\right )}{\sqrt{d^2-4 c e}}\\ \end{align*}

Mathematica [A]  time = 0.541585, size = 236, normalized size = 0.87 \[ \frac{\cos \left (a+\frac{b \left (\sqrt{d^2-4 c e}-d\right )}{2 e}\right ) \text{CosIntegral}\left (\frac{b \left (-\sqrt{d^2-4 c e}+d+2 e x\right )}{2 e}\right )-\cos \left (a-\frac{b \left (\sqrt{d^2-4 c e}+d\right )}{2 e}\right ) \text{CosIntegral}\left (\frac{b \left (\sqrt{d^2-4 c e}+d+2 e x\right )}{2 e}\right )+\sin \left (a+\frac{b \left (\sqrt{d^2-4 c e}-d\right )}{2 e}\right ) \text{Si}\left (\frac{b \left (\sqrt{d^2-4 c e}-d\right )}{2 e}-b x\right )+\sin \left (a-\frac{b \left (\sqrt{d^2-4 c e}+d\right )}{2 e}\right ) \text{Si}\left (\frac{b \left (d+2 e x+\sqrt{d^2-4 c e}\right )}{2 e}\right )}{\sqrt{d^2-4 c e}} \]

Warning: Unable to verify antiderivative.

[In]

Integrate[Cos[a + b*x]/(c + d*x + e*x^2),x]

[Out]

(Cos[a + (b*(-d + Sqrt[d^2 - 4*c*e]))/(2*e)]*CosIntegral[(b*(d - Sqrt[d^2 - 4*c*e] + 2*e*x))/(2*e)] - Cos[a -
(b*(d + Sqrt[d^2 - 4*c*e]))/(2*e)]*CosIntegral[(b*(d + Sqrt[d^2 - 4*c*e] + 2*e*x))/(2*e)] + Sin[a + (b*(-d + S
qrt[d^2 - 4*c*e]))/(2*e)]*SinIntegral[(b*(-d + Sqrt[d^2 - 4*c*e]))/(2*e) - b*x] + Sin[a - (b*(d + Sqrt[d^2 - 4
*c*e]))/(2*e)]*SinIntegral[(b*(d + Sqrt[d^2 - 4*c*e] + 2*e*x))/(2*e)])/Sqrt[d^2 - 4*c*e]

________________________________________________________________________________________

Maple [A]  time = 0.017, size = 320, normalized size = 1.2 \begin{align*} b \left ({ \left ( -{\it Si} \left ( bx+a-{\frac{1}{2\,e} \left ( 2\,ae-db+\sqrt{-4\,{b}^{2}ce+{b}^{2}{d}^{2}} \right ) } \right ) \sin \left ({\frac{1}{2\,e} \left ( 2\,ae-db+\sqrt{-4\,{b}^{2}ce+{b}^{2}{d}^{2}} \right ) } \right ) +{\it Ci} \left ( bx+a-{\frac{1}{2\,e} \left ( 2\,ae-db+\sqrt{-4\,{b}^{2}ce+{b}^{2}{d}^{2}} \right ) } \right ) \cos \left ({\frac{1}{2\,e} \left ( 2\,ae-db+\sqrt{-4\,{b}^{2}ce+{b}^{2}{d}^{2}} \right ) } \right ) \right ){\frac{1}{\sqrt{-4\,{b}^{2}ce+{b}^{2}{d}^{2}}}}}-{ \left ({\it Si} \left ( bx+a+{\frac{1}{2\,e} \left ( -2\,ae+db+\sqrt{-4\,{b}^{2}ce+{b}^{2}{d}^{2}} \right ) } \right ) \sin \left ({\frac{1}{2\,e} \left ( -2\,ae+db+\sqrt{-4\,{b}^{2}ce+{b}^{2}{d}^{2}} \right ) } \right ) +{\it Ci} \left ( bx+a+{\frac{1}{2\,e} \left ( -2\,ae+db+\sqrt{-4\,{b}^{2}ce+{b}^{2}{d}^{2}} \right ) } \right ) \cos \left ({\frac{1}{2\,e} \left ( -2\,ae+db+\sqrt{-4\,{b}^{2}ce+{b}^{2}{d}^{2}} \right ) } \right ) \right ){\frac{1}{\sqrt{-4\,{b}^{2}ce+{b}^{2}{d}^{2}}}}} \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(b*x+a)/(e*x^2+d*x+c),x)

[Out]

b*(1/(-4*b^2*c*e+b^2*d^2)^(1/2)*(-Si(b*x+a-1/2/e*(2*a*e-d*b+(-4*b^2*c*e+b^2*d^2)^(1/2)))*sin(1/2/e*(2*a*e-d*b+
(-4*b^2*c*e+b^2*d^2)^(1/2)))+Ci(b*x+a-1/2/e*(2*a*e-d*b+(-4*b^2*c*e+b^2*d^2)^(1/2)))*cos(1/2/e*(2*a*e-d*b+(-4*b
^2*c*e+b^2*d^2)^(1/2))))-1/(-4*b^2*c*e+b^2*d^2)^(1/2)*(Si(b*x+a+1/2*(-2*a*e+d*b+(-4*b^2*c*e+b^2*d^2)^(1/2))/e)
*sin(1/2*(-2*a*e+d*b+(-4*b^2*c*e+b^2*d^2)^(1/2))/e)+Ci(b*x+a+1/2*(-2*a*e+d*b+(-4*b^2*c*e+b^2*d^2)^(1/2))/e)*co
s(1/2*(-2*a*e+d*b+(-4*b^2*c*e+b^2*d^2)^(1/2))/e)))

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\cos \left (b x + a\right )}{e x^{2} + d x + c}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x+a)/(e*x^2+d*x+c),x, algorithm="maxima")

[Out]

integrate(cos(b*x + a)/(e*x^2 + d*x + c), x)

________________________________________________________________________________________

Fricas [C]  time = 2.64289, size = 963, normalized size = 3.55 \begin{align*} -\frac{-i \, e \sqrt{-\frac{b^{2} d^{2} - 4 \, b^{2} c e}{e^{2}}}{\rm Ei}\left (\frac{-2 i \, b e x - i \, b d - e \sqrt{-\frac{b^{2} d^{2} - 4 \, b^{2} c e}{e^{2}}}}{2 \, e}\right ) e^{\left (\frac{i \, b d - 2 i \, a e + e \sqrt{-\frac{b^{2} d^{2} - 4 \, b^{2} c e}{e^{2}}}}{2 \, e}\right )} + i \, e \sqrt{-\frac{b^{2} d^{2} - 4 \, b^{2} c e}{e^{2}}}{\rm Ei}\left (\frac{-2 i \, b e x - i \, b d + e \sqrt{-\frac{b^{2} d^{2} - 4 \, b^{2} c e}{e^{2}}}}{2 \, e}\right ) e^{\left (\frac{i \, b d - 2 i \, a e - e \sqrt{-\frac{b^{2} d^{2} - 4 \, b^{2} c e}{e^{2}}}}{2 \, e}\right )} + i \, e \sqrt{-\frac{b^{2} d^{2} - 4 \, b^{2} c e}{e^{2}}}{\rm Ei}\left (\frac{2 i \, b e x + i \, b d - e \sqrt{-\frac{b^{2} d^{2} - 4 \, b^{2} c e}{e^{2}}}}{2 \, e}\right ) e^{\left (\frac{-i \, b d + 2 i \, a e + e \sqrt{-\frac{b^{2} d^{2} - 4 \, b^{2} c e}{e^{2}}}}{2 \, e}\right )} - i \, e \sqrt{-\frac{b^{2} d^{2} - 4 \, b^{2} c e}{e^{2}}}{\rm Ei}\left (\frac{2 i \, b e x + i \, b d + e \sqrt{-\frac{b^{2} d^{2} - 4 \, b^{2} c e}{e^{2}}}}{2 \, e}\right ) e^{\left (\frac{-i \, b d + 2 i \, a e - e \sqrt{-\frac{b^{2} d^{2} - 4 \, b^{2} c e}{e^{2}}}}{2 \, e}\right )}}{2 \,{\left (b d^{2} - 4 \, b c e\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x+a)/(e*x^2+d*x+c),x, algorithm="fricas")

[Out]

-1/2*(-I*e*sqrt(-(b^2*d^2 - 4*b^2*c*e)/e^2)*Ei(1/2*(-2*I*b*e*x - I*b*d - e*sqrt(-(b^2*d^2 - 4*b^2*c*e)/e^2))/e
)*e^(1/2*(I*b*d - 2*I*a*e + e*sqrt(-(b^2*d^2 - 4*b^2*c*e)/e^2))/e) + I*e*sqrt(-(b^2*d^2 - 4*b^2*c*e)/e^2)*Ei(1
/2*(-2*I*b*e*x - I*b*d + e*sqrt(-(b^2*d^2 - 4*b^2*c*e)/e^2))/e)*e^(1/2*(I*b*d - 2*I*a*e - e*sqrt(-(b^2*d^2 - 4
*b^2*c*e)/e^2))/e) + I*e*sqrt(-(b^2*d^2 - 4*b^2*c*e)/e^2)*Ei(1/2*(2*I*b*e*x + I*b*d - e*sqrt(-(b^2*d^2 - 4*b^2
*c*e)/e^2))/e)*e^(1/2*(-I*b*d + 2*I*a*e + e*sqrt(-(b^2*d^2 - 4*b^2*c*e)/e^2))/e) - I*e*sqrt(-(b^2*d^2 - 4*b^2*
c*e)/e^2)*Ei(1/2*(2*I*b*e*x + I*b*d + e*sqrt(-(b^2*d^2 - 4*b^2*c*e)/e^2))/e)*e^(1/2*(-I*b*d + 2*I*a*e - e*sqrt
(-(b^2*d^2 - 4*b^2*c*e)/e^2))/e))/(b*d^2 - 4*b*c*e)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\cos{\left (a + b x \right )}}{c + d x + e x^{2}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x+a)/(e*x**2+d*x+c),x)

[Out]

Integral(cos(a + b*x)/(c + d*x + e*x**2), x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\cos \left (b x + a\right )}{e x^{2} + d x + c}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x+a)/(e*x^2+d*x+c),x, algorithm="giac")

[Out]

integrate(cos(b*x + a)/(e*x^2 + d*x + c), x)