Integrand size = 14, antiderivative size = 101 \[ \int \cos \left (\frac {a+b x}{c+d x}\right ) \, dx=\frac {(c+d x) \cos \left (\frac {a+b x}{c+d x}\right )}{d}-\frac {(b c-a d) \operatorname {CosIntegral}\left (\frac {b c-a d}{d (c+d x)}\right ) \sin \left (\frac {b}{d}\right )}{d^2}+\frac {(b c-a d) \cos \left (\frac {b}{d}\right ) \text {Si}\left (\frac {b c-a d}{d (c+d x)}\right )}{d^2} \]
[Out]
Time = 0.17 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.357, Rules used = {4660, 3378, 3384, 3380, 3383} \[ \int \cos \left (\frac {a+b x}{c+d x}\right ) \, dx=-\frac {\sin \left (\frac {b}{d}\right ) (b c-a d) \operatorname {CosIntegral}\left (\frac {b c-a d}{d (c+d x)}\right )}{d^2}+\frac {\cos \left (\frac {b}{d}\right ) (b c-a d) \text {Si}\left (\frac {b c-a d}{d (c+d x)}\right )}{d^2}+\frac {(c+d x) \cos \left (\frac {a+b x}{c+d x}\right )}{d} \]
[In]
[Out]
Rule 3378
Rule 3380
Rule 3383
Rule 3384
Rule 4660
Rubi steps \begin{align*} \text {integral}& = -\frac {\text {Subst}\left (\int \frac {\cos \left (\frac {b}{d}-\frac {(b c-a d) x}{d}\right )}{x^2} \, dx,x,\frac {1}{c+d x}\right )}{d} \\ & = \frac {(c+d x) \cos \left (\frac {a+b x}{c+d x}\right )}{d}-\frac {(b c-a d) \text {Subst}\left (\int \frac {\sin \left (\frac {b}{d}-\frac {(b c-a d) x}{d}\right )}{x} \, dx,x,\frac {1}{c+d x}\right )}{d^2} \\ & = \frac {(c+d x) \cos \left (\frac {a+b x}{c+d x}\right )}{d}+\frac {\left ((b c-a d) \cos \left (\frac {b}{d}\right )\right ) \text {Subst}\left (\int \frac {\sin \left (\frac {(b c-a d) x}{d}\right )}{x} \, dx,x,\frac {1}{c+d x}\right )}{d^2}-\frac {\left ((b c-a d) \sin \left (\frac {b}{d}\right )\right ) \text {Subst}\left (\int \frac {\cos \left (\frac {(b c-a d) x}{d}\right )}{x} \, dx,x,\frac {1}{c+d x}\right )}{d^2} \\ & = \frac {(c+d x) \cos \left (\frac {a+b x}{c+d x}\right )}{d}-\frac {(b c-a d) \operatorname {CosIntegral}\left (\frac {b c-a d}{d (c+d x)}\right ) \sin \left (\frac {b}{d}\right )}{d^2}+\frac {(b c-a d) \cos \left (\frac {b}{d}\right ) \text {Si}\left (\frac {b c-a d}{d (c+d x)}\right )}{d^2} \\ \end{align*}
Result contains complex when optimal does not.
Time = 0.79 (sec) , antiderivative size = 319, normalized size of antiderivative = 3.16 \[ \int \cos \left (\frac {a+b x}{c+d x}\right ) \, dx=\frac {c d e^{-\frac {i (a+b x)}{c+d x}}+c d e^{\frac {i (a+b x)}{c+d x}}+2 d^2 x \cos \left (\frac {b}{d}\right ) \cos \left (\frac {-b c+a d}{d (c+d x)}\right )-2 d^2 x \sin \left (\frac {b}{d}\right ) \sin \left (\frac {-b c+a d}{d (c+d x)}\right )-(b c-a d) \left (\operatorname {CosIntegral}\left (\frac {b c-a d}{c d+d^2 x}\right ) \left (-i \cos \left (\frac {b}{d}\right )+\sin \left (\frac {b}{d}\right )\right )+\operatorname {CosIntegral}\left (\frac {-b c+a d}{d (c+d x)}\right ) \left (i \cos \left (\frac {b}{d}\right )+\sin \left (\frac {b}{d}\right )\right )+\cos \left (\frac {b}{d}\right ) \text {Si}\left (\frac {-b c+a d}{d (c+d x)}\right )+i \sin \left (\frac {b}{d}\right ) \text {Si}\left (\frac {-b c+a d}{d (c+d x)}\right )-\cos \left (\frac {b}{d}\right ) \text {Si}\left (\frac {b c-a d}{c d+d^2 x}\right )+i \sin \left (\frac {b}{d}\right ) \text {Si}\left (\frac {b c-a d}{c d+d^2 x}\right )\right )}{2 d^2} \]
[In]
[Out]
Time = 1.54 (sec) , antiderivative size = 142, normalized size of antiderivative = 1.41
method | result | size |
derivativedivides | \(-\left (a d -c b \right ) \left (-\frac {\cos \left (\frac {b}{d}+\frac {a d -c b}{d \left (d x +c \right )}\right )}{\left (\left (\frac {b}{d}+\frac {a d -c b}{d \left (d x +c \right )}\right ) d -b \right ) d}-\frac {\frac {\operatorname {Si}\left (\frac {a d -c b}{d \left (d x +c \right )}\right ) \cos \left (\frac {b}{d}\right )}{d}+\frac {\operatorname {Ci}\left (\frac {a d -c b}{d \left (d x +c \right )}\right ) \sin \left (\frac {b}{d}\right )}{d}}{d}\right )\) | \(142\) |
default | \(-\left (a d -c b \right ) \left (-\frac {\cos \left (\frac {b}{d}+\frac {a d -c b}{d \left (d x +c \right )}\right )}{\left (\left (\frac {b}{d}+\frac {a d -c b}{d \left (d x +c \right )}\right ) d -b \right ) d}-\frac {\frac {\operatorname {Si}\left (\frac {a d -c b}{d \left (d x +c \right )}\right ) \cos \left (\frac {b}{d}\right )}{d}+\frac {\operatorname {Ci}\left (\frac {a d -c b}{d \left (d x +c \right )}\right ) \sin \left (\frac {b}{d}\right )}{d}}{d}\right )\) | \(142\) |
risch | \(\frac {i \operatorname {Ei}_{1}\left (-\frac {i \left (a d -c b \right )}{d \left (d x +c \right )}\right ) {\mathrm e}^{\frac {i b}{d}} a}{2 d}-\frac {i \operatorname {Ei}_{1}\left (-\frac {i \left (a d -c b \right )}{d \left (d x +c \right )}\right ) {\mathrm e}^{\frac {i b}{d}} c b}{2 d^{2}}-\frac {{\mathrm e}^{-\frac {i b}{d}} \pi \,\operatorname {csgn}\left (\frac {a d -c b}{d \left (d x +c \right )}\right ) a}{2 d}+\frac {{\mathrm e}^{-\frac {i b}{d}} \pi \,\operatorname {csgn}\left (\frac {a d -c b}{d \left (d x +c \right )}\right ) b c}{2 d^{2}}+\frac {{\mathrm e}^{-\frac {i b}{d}} \operatorname {Si}\left (\frac {a d -c b}{d \left (d x +c \right )}\right ) a}{d}-\frac {{\mathrm e}^{-\frac {i b}{d}} \operatorname {Si}\left (\frac {a d -c b}{d \left (d x +c \right )}\right ) b c}{d^{2}}-\frac {i {\mathrm e}^{-\frac {i b}{d}} \operatorname {Ei}_{1}\left (-\frac {i \left (a d -c b \right )}{d \left (d x +c \right )}\right ) a}{2 d}+\frac {i {\mathrm e}^{-\frac {i b}{d}} \operatorname {Ei}_{1}\left (-\frac {i \left (a d -c b \right )}{d \left (d x +c \right )}\right ) b c}{2 d^{2}}+\cos \left (\frac {x b +a}{d x +c}\right ) x +\frac {\cos \left (\frac {x b +a}{d x +c}\right ) c}{d}\) | \(330\) |
[In]
[Out]
none
Time = 0.24 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.04 \[ \int \cos \left (\frac {a+b x}{c+d x}\right ) \, dx=-\frac {{\left (b c - a d\right )} \operatorname {Ci}\left (-\frac {b c - a d}{d^{2} x + c d}\right ) \sin \left (\frac {b}{d}\right ) + {\left (b c - a d\right )} \cos \left (\frac {b}{d}\right ) \operatorname {Si}\left (-\frac {b c - a d}{d^{2} x + c d}\right ) - {\left (d^{2} x + c d\right )} \cos \left (\frac {b x + a}{d x + c}\right )}{d^{2}} \]
[In]
[Out]
\[ \int \cos \left (\frac {a+b x}{c+d x}\right ) \, dx=\int \cos {\left (\frac {a + b x}{c + d x} \right )}\, dx \]
[In]
[Out]
\[ \int \cos \left (\frac {a+b x}{c+d x}\right ) \, dx=\int { \cos \left (\frac {b x + a}{d x + c}\right ) \,d x } \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 633 vs. \(2 (101) = 202\).
Time = 5.26 (sec) , antiderivative size = 633, normalized size of antiderivative = 6.27 \[ \int \cos \left (\frac {a+b x}{c+d x}\right ) \, dx=-\frac {{\left (b^{3} c^{2} \operatorname {Ci}\left (-\frac {b - \frac {{\left (b x + a\right )} d}{d x + c}}{d}\right ) \sin \left (\frac {b}{d}\right ) - 2 \, a b^{2} c d \operatorname {Ci}\left (-\frac {b - \frac {{\left (b x + a\right )} d}{d x + c}}{d}\right ) \sin \left (\frac {b}{d}\right ) - \frac {{\left (b x + a\right )} b^{2} c^{2} d \operatorname {Ci}\left (-\frac {b - \frac {{\left (b x + a\right )} d}{d x + c}}{d}\right ) \sin \left (\frac {b}{d}\right )}{d x + c} + a^{2} b d^{2} \operatorname {Ci}\left (-\frac {b - \frac {{\left (b x + a\right )} d}{d x + c}}{d}\right ) \sin \left (\frac {b}{d}\right ) + \frac {2 \, {\left (b x + a\right )} a b c d^{2} \operatorname {Ci}\left (-\frac {b - \frac {{\left (b x + a\right )} d}{d x + c}}{d}\right ) \sin \left (\frac {b}{d}\right )}{d x + c} - \frac {{\left (b x + a\right )} a^{2} d^{3} \operatorname {Ci}\left (-\frac {b - \frac {{\left (b x + a\right )} d}{d x + c}}{d}\right ) \sin \left (\frac {b}{d}\right )}{d x + c} - b^{3} c^{2} \cos \left (\frac {b}{d}\right ) \operatorname {Si}\left (\frac {b - \frac {{\left (b x + a\right )} d}{d x + c}}{d}\right ) + 2 \, a b^{2} c d \cos \left (\frac {b}{d}\right ) \operatorname {Si}\left (\frac {b - \frac {{\left (b x + a\right )} d}{d x + c}}{d}\right ) + \frac {{\left (b x + a\right )} b^{2} c^{2} d \cos \left (\frac {b}{d}\right ) \operatorname {Si}\left (\frac {b - \frac {{\left (b x + a\right )} d}{d x + c}}{d}\right )}{d x + c} - a^{2} b d^{2} \cos \left (\frac {b}{d}\right ) \operatorname {Si}\left (\frac {b - \frac {{\left (b x + a\right )} d}{d x + c}}{d}\right ) - \frac {2 \, {\left (b x + a\right )} a b c d^{2} \cos \left (\frac {b}{d}\right ) \operatorname {Si}\left (\frac {b - \frac {{\left (b x + a\right )} d}{d x + c}}{d}\right )}{d x + c} + \frac {{\left (b x + a\right )} a^{2} d^{3} \cos \left (\frac {b}{d}\right ) \operatorname {Si}\left (\frac {b - \frac {{\left (b x + a\right )} d}{d x + c}}{d}\right )}{d x + c} - b^{2} c^{2} d \cos \left (\frac {b x + a}{d x + c}\right ) + 2 \, a b c d^{2} \cos \left (\frac {b x + a}{d x + c}\right ) - a^{2} d^{3} \cos \left (\frac {b x + a}{d x + c}\right )\right )} {\left (\frac {b c}{{\left (b c - a d\right )}^{2}} - \frac {a d}{{\left (b c - a d\right )}^{2}}\right )}}{b d^{2} - \frac {{\left (b x + a\right )} d^{3}}{d x + c}} \]
[In]
[Out]
Timed out. \[ \int \cos \left (\frac {a+b x}{c+d x}\right ) \, dx=\int \cos \left (\frac {a+b\,x}{c+d\,x}\right ) \,d x \]
[In]
[Out]