Integrand size = 19, antiderivative size = 271 \[ \int \frac {\cos (a+b x)}{c+d x+e x^2} \, dx=\frac {\cos \left (a-\frac {b \left (d-\sqrt {d^2-4 c e}\right )}{2 e}\right ) \operatorname {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 (d+\sqrt {d^2-4 c e}\right )}{2 e}\right ) \operatorname {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 {\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}} \] Output:
cos(a-1/2*b*(d-(-4*c*e+d^2)^(1/2))/e)*Ci(1/2*b*(d-(-4*c*e+d^2)^(1/2))/e+b* x)/(-4*c*e+d^2)^(1/2)-cos(a-1/2*b*(d+(-4*c*e+d^2)^(1/2))/e)*Ci(1/2*b*(d+(- 4*c*e+d^2)^(1/2))/e+b*x)/(-4*c*e+d^2)^(1/2)-sin(a-1/2*b*(d-(-4*c*e+d^2)^(1 /2))/e)*Si(1/2*b*(d-(-4*c*e+d^2)^(1/2))/e+b*x)/(-4*c*e+d^2)^(1/2)+sin(a-1/ 2*b*(d+(-4*c*e+d^2)^(1/2))/e)*Si(1/2*b*(d+(-4*c*e+d^2)^(1/2))/e+b*x)/(-4*c *e+d^2)^(1/2)
Result contains complex when optimal does not.
Time = 0.66 (sec) , antiderivative size = 243, normalized size of antiderivative = 0.90 \[ \int \frac {\cos (a+b x)}{c+d x+e x^2} \, dx=\frac {e^{-\frac {1}{2} i \left (2 a+\frac {b \left (d+\sqrt {d^2-4 c e}\right )}{e}\right )} \left (e^{\frac {i b d}{e}} \operatorname {ExpIntegralEi}\left (-\frac {i b \left (d-\sqrt {d^2-4 c e}+2 e x\right )}{2 e}\right )+e^{i \left (2 a+\frac {b \sqrt {d^2-4 c e}}{e}\right )} \operatorname {ExpIntegralEi}\left (\frac {i b \left (d-\sqrt {d^2-4 c e}+2 e x\right )}{2 e}\right )-e^{\frac {i b \left (d+\sqrt {d^2-4 c e}\right )}{e}} \operatorname {ExpIntegralEi}\left (-\frac {i b \left (d+\sqrt {d^2-4 c e}+2 e x\right )}{2 e}\right )-e^{2 i a} \operatorname {ExpIntegralEi}\left (\frac {i b \left (d+\sqrt {d^2-4 c e}+2 e x\right )}{2 e}\right )\right )}{2 \sqrt {d^2-4 c e}} \] Input:
Integrate[Cos[a + b*x]/(c + d*x + e*x^2),x]
Output:
(E^((I*b*d)/e)*ExpIntegralEi[((-1/2*I)*b*(d - Sqrt[d^2 - 4*c*e] + 2*e*x))/ e] + E^(I*(2*a + (b*Sqrt[d^2 - 4*c*e])/e))*ExpIntegralEi[((I/2)*b*(d - Sqr t[d^2 - 4*c*e] + 2*e*x))/e] - E^((I*b*(d + Sqrt[d^2 - 4*c*e]))/e)*ExpInteg ralEi[((-1/2*I)*b*(d + Sqrt[d^2 - 4*c*e] + 2*e*x))/e] - E^((2*I)*a)*ExpInt egralEi[((I/2)*b*(d + Sqrt[d^2 - 4*c*e] + 2*e*x))/e])/(2*Sqrt[d^2 - 4*c*e] *E^((I/2)*(2*a + (b*(d + Sqrt[d^2 - 4*c*e]))/e)))
Time = 0.83 (sec) , antiderivative size = 271, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {7279, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\cos (a+b x)}{c+d x+e x^2} \, dx\) |
\(\Big \downarrow \) 7279 |
\(\displaystyle \int \left (\frac {2 e \cos (a+b x)}{\sqrt {d^2-4 c e} \left (-\sqrt {d^2-4 c e}+d+2 e x\right )}-\frac {2 e \cos (a+b x)}{\sqrt {d^2-4 c e} \left (\sqrt {d^2-4 c e}+d+2 e x\right )}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {\cos \left (a-\frac {b \left (d-\sqrt {d^2-4 c e}\right )}{2 e}\right ) \operatorname {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 ) \operatorname {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 {\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}}\) |
Input:
Int[Cos[a + b*x]/(c + d*x + e*x^2),x]
Output:
(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]
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] /; Su mQ[v]] /; FreeQ[{a, b, c}, x] && EqQ[n2, 2*n] && IGtQ[n, 0]
Time = 0.46 (sec) , antiderivative size = 326, normalized size of antiderivative = 1.20
method | result | size |
derivativedivides | \(b \left (\frac {\operatorname {Si}\left (-b x -a +\frac {2 a e -d b +\sqrt {-4 b^{2} c e +b^{2} d^{2}}}{2 e}\right ) \sin \left (\frac {2 a e -d b +\sqrt {-4 b^{2} c e +b^{2} d^{2}}}{2 e}\right )+\operatorname {Ci}\left (b x +a -\frac {2 a e -d b +\sqrt {-4 b^{2} c e +b^{2} d^{2}}}{2 e}\right ) \cos \left (\frac {2 a e -d b +\sqrt {-4 b^{2} c e +b^{2} d^{2}}}{2 e}\right )}{\sqrt {-4 b^{2} c e +b^{2} d^{2}}}-\frac {-\operatorname {Si}\left (-b x -a -\frac {-2 a e +d b +\sqrt {-4 b^{2} c e +b^{2} d^{2}}}{2 e}\right ) \sin \left (\frac {-2 a e +d b +\sqrt {-4 b^{2} c e +b^{2} d^{2}}}{2 e}\right )+\operatorname {Ci}\left (b x +a +\frac {-2 a e +d b +\sqrt {-4 b^{2} c e +b^{2} d^{2}}}{2 e}\right ) \cos \left (\frac {-2 a e +d b +\sqrt {-4 b^{2} c e +b^{2} d^{2}}}{2 e}\right )}{\sqrt {-4 b^{2} c e +b^{2} d^{2}}}\right )\) | \(326\) |
default | \(b \left (\frac {\operatorname {Si}\left (-b x -a +\frac {2 a e -d b +\sqrt {-4 b^{2} c e +b^{2} d^{2}}}{2 e}\right ) \sin \left (\frac {2 a e -d b +\sqrt {-4 b^{2} c e +b^{2} d^{2}}}{2 e}\right )+\operatorname {Ci}\left (b x +a -\frac {2 a e -d b +\sqrt {-4 b^{2} c e +b^{2} d^{2}}}{2 e}\right ) \cos \left (\frac {2 a e -d b +\sqrt {-4 b^{2} c e +b^{2} d^{2}}}{2 e}\right )}{\sqrt {-4 b^{2} c e +b^{2} d^{2}}}-\frac {-\operatorname {Si}\left (-b x -a -\frac {-2 a e +d b +\sqrt {-4 b^{2} c e +b^{2} d^{2}}}{2 e}\right ) \sin \left (\frac {-2 a e +d b +\sqrt {-4 b^{2} c e +b^{2} d^{2}}}{2 e}\right )+\operatorname {Ci}\left (b x +a +\frac {-2 a e +d b +\sqrt {-4 b^{2} c e +b^{2} d^{2}}}{2 e}\right ) \cos \left (\frac {-2 a e +d b +\sqrt {-4 b^{2} c e +b^{2} d^{2}}}{2 e}\right )}{\sqrt {-4 b^{2} c e +b^{2} d^{2}}}\right )\) | \(326\) |
risch | \(-\frac {i \sqrt {4 b^{2} c e -b^{2} d^{2}}\, {\mathrm e}^{\frac {2 i a e -i d b +\sqrt {4 b^{2} c e -b^{2} d^{2}}}{2 e}} \operatorname {expIntegral}_{1}\left (\frac {2 i a e -i d b -2 e \left (i b x +i a \right )+\sqrt {4 b^{2} c e -b^{2} d^{2}}}{2 e}\right )}{2 b \left (4 c e -d^{2}\right )}+\frac {i \sqrt {4 b^{2} c e -b^{2} d^{2}}\, {\mathrm e}^{\frac {2 i a e -i d b -\sqrt {4 b^{2} c e -b^{2} d^{2}}}{2 e}} \operatorname {expIntegral}_{1}\left (\frac {2 i a e -i d b -2 e \left (i b x +i a \right )-\sqrt {4 b^{2} c e -b^{2} d^{2}}}{2 e}\right )}{2 b \left (4 c e -d^{2}\right )}-\frac {i \sqrt {4 b^{2} c e -b^{2} d^{2}}\, \operatorname {expIntegral}_{1}\left (-\frac {2 i a e -i d b -2 e \left (i b x +i a \right )+\sqrt {4 b^{2} c e -b^{2} d^{2}}}{2 e}\right ) {\mathrm e}^{-\frac {2 i a e -i d b +\sqrt {4 b^{2} c e -b^{2} d^{2}}}{2 e}}}{2 b \left (4 c e -d^{2}\right )}+\frac {i \sqrt {4 b^{2} c e -b^{2} d^{2}}\, \operatorname {expIntegral}_{1}\left (-\frac {2 i a e -i d b -2 e \left (i b x +i a \right )-\sqrt {4 b^{2} c e -b^{2} d^{2}}}{2 e}\right ) {\mathrm e}^{-\frac {2 i a e -i d b -\sqrt {4 b^{2} c e -b^{2} d^{2}}}{2 e}}}{2 b \left (4 c e -d^{2}\right )}\) | \(490\) |
Input:
int(cos(b*x+a)/(e*x^2+d*x+c),x,method=_RETURNVERBOSE)
Output:
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)*cos( 1/2*(-2*a*e+d*b+(-4*b^2*c*e+b^2*d^2)^(1/2))/e)))
Result contains complex when optimal does not.
Time = 0.10 (sec) , antiderivative size = 436, normalized size of antiderivative = 1.61 \[ \int \frac {\cos (a+b x)}{c+d x+e x^2} \, dx=-\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 )}} \] Input:
integrate(cos(b*x+a)/(e*x^2+d*x+c),x, algorithm="fricas")
Output:
-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*sq rt(-(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)
\[ \int \frac {\cos (a+b x)}{c+d x+e x^2} \, dx=\int \frac {\cos {\left (a + b x \right )}}{c + d x + e x^{2}}\, dx \] Input:
integrate(cos(b*x+a)/(e*x**2+d*x+c),x)
Output:
Integral(cos(a + b*x)/(c + d*x + e*x**2), x)
\[ \int \frac {\cos (a+b x)}{c+d x+e x^2} \, dx=\int { \frac {\cos \left (b x + a\right )}{e x^{2} + d x + c} \,d x } \] Input:
integrate(cos(b*x+a)/(e*x^2+d*x+c),x, algorithm="maxima")
Output:
integrate(cos(b*x + a)/(e*x^2 + d*x + c), x)
\[ \int \frac {\cos (a+b x)}{c+d x+e x^2} \, dx=\int { \frac {\cos \left (b x + a\right )}{e x^{2} + d x + c} \,d x } \] Input:
integrate(cos(b*x+a)/(e*x^2+d*x+c),x, algorithm="giac")
Output:
integrate(cos(b*x + a)/(e*x^2 + d*x + c), x)
Timed out. \[ \int \frac {\cos (a+b x)}{c+d x+e x^2} \, dx=\int \frac {\cos \left (a+b\,x\right )}{e\,x^2+d\,x+c} \,d x \] Input:
int(cos(a + b*x)/(c + d*x + e*x^2),x)
Output:
int(cos(a + b*x)/(c + d*x + e*x^2), x)
\[ \int \frac {\cos (a+b x)}{c+d x+e x^2} \, dx=\frac {-2 \sqrt {4 c e -d^{2}}\, \mathit {atan} \left (\frac {2 e x +d}{\sqrt {4 c e -d^{2}}}\right )+4 \left (\int \frac {\cos \left (b x +a \right )}{e \,x^{2}+d x +c}d x \right ) c e -\left (\int \frac {\cos \left (b x +a \right )}{e \,x^{2}+d x +c}d x \right ) d^{2}+4 \left (\int \frac {1}{e \,x^{2}+d x +c}d x \right ) c e -\left (\int \frac {1}{e \,x^{2}+d x +c}d x \right ) d^{2}}{4 c e -d^{2}} \] Input:
int(cos(b*x+a)/(e*x^2+d*x+c),x)
Output:
( - 2*sqrt(4*c*e - d**2)*atan((d + 2*e*x)/sqrt(4*c*e - d**2)) + 4*int(cos( a + b*x)/(c + d*x + e*x**2),x)*c*e - int(cos(a + b*x)/(c + d*x + e*x**2),x )*d**2 + 4*int(1/(c + d*x + e*x**2),x)*c*e - int(1/(c + d*x + e*x**2),x)*d **2)/(4*c*e - d**2)