Integrand size = 19, antiderivative size = 115 \[ \int \frac {\left (c+d x^n\right )^2}{\left (a+b x^n\right )^2} \, dx=-\frac {d (b c-a d (1+n)) x}{a b^2 n}+\frac {(b c-a d) x \left (c+d x^n\right )}{a b n \left (a+b x^n\right )}-\frac {(b c-a d) (b c (1-n)-a d (1+n)) x \operatorname {Hypergeometric2F1}\left (1,\frac {1}{n},1+\frac {1}{n},-\frac {b x^n}{a}\right )}{a^2 b^2 n} \] Output:
-d*(b*c-a*d*(1+n))*x/a/b^2/n+(-a*d+b*c)*x*(c+d*x^n)/a/b/n/(a+b*x^n)-(-a*d+ b*c)*(b*c*(1-n)-a*d*(1+n))*x*hypergeom([1, 1/n],[1+1/n],-b*x^n/a)/a^2/b^2/ n
Result contains higher order function than in optimal. Order 9 vs. order 5 in optimal.
Time = 1.97 (sec) , antiderivative size = 666, normalized size of antiderivative = 5.79 \[ \int \frac {\left (c+d x^n\right )^2}{\left (a+b x^n\right )^2} \, dx=\frac {x \left (-2 a \left (1+6 n+11 n^2+6 n^3\right ) \left (c^2 (1+n)^3+2 c d \left (1+3 n+4 n^2+n^3\right ) x^n+d^2 (1+n)^3 x^{2 n}\right ) \Phi \left (-\frac {b x^n}{a},1,1+\frac {1}{n}\right )+a \left (1+6 n+11 n^2+6 n^3\right ) \left (c^2 (1+2 n)^3+2 c d (1+2 n)^3 x^n+d^2 \left (1+6 n+10 n^2+6 n^3\right ) x^{2 n}\right ) \Phi \left (-\frac {b x^n}{a},1,2+\frac {1}{n}\right )+a c^2 \Phi \left (-\frac {b x^n}{a},1,\frac {1}{n}\right )+6 a c^2 n \Phi \left (-\frac {b x^n}{a},1,\frac {1}{n}\right )+9 a c^2 n^2 \Phi \left (-\frac {b x^n}{a},1,\frac {1}{n}\right )-4 a c^2 n^3 \Phi \left (-\frac {b x^n}{a},1,\frac {1}{n}\right )-10 a c^2 n^4 \Phi \left (-\frac {b x^n}{a},1,\frac {1}{n}\right )+10 a c^2 n^5 \Phi \left (-\frac {b x^n}{a},1,\frac {1}{n}\right )+12 a c^2 n^6 \Phi \left (-\frac {b x^n}{a},1,\frac {1}{n}\right )+2 a c d x^n \Phi \left (-\frac {b x^n}{a},1,\frac {1}{n}\right )+12 a c d n x^n \Phi \left (-\frac {b x^n}{a},1,\frac {1}{n}\right )+22 a c d n^2 x^n \Phi \left (-\frac {b x^n}{a},1,\frac {1}{n}\right )+12 a c d n^3 x^n \Phi \left (-\frac {b x^n}{a},1,\frac {1}{n}\right )+a d^2 x^{2 n} \Phi \left (-\frac {b x^n}{a},1,\frac {1}{n}\right )+6 a d^2 n x^{2 n} \Phi \left (-\frac {b x^n}{a},1,\frac {1}{n}\right )+11 a d^2 n^2 x^{2 n} \Phi \left (-\frac {b x^n}{a},1,\frac {1}{n}\right )+6 a d^2 n^3 x^{2 n} \Phi \left (-\frac {b x^n}{a},1,\frac {1}{n}\right )-2 b c^2 n^6 x^n \, _4F_3\left (2,2,2,1+\frac {1}{n};1,1,4+\frac {1}{n};-\frac {b x^n}{a}\right )-4 b c d n^6 x^{2 n} \, _4F_3\left (2,2,2,1+\frac {1}{n};1,1,4+\frac {1}{n};-\frac {b x^n}{a}\right )-2 b d^2 n^6 x^{3 n} \, _4F_3\left (2,2,2,1+\frac {1}{n};1,1,4+\frac {1}{n};-\frac {b x^n}{a}\right )\right )}{2 a^3 n^4 \left (1+6 n+11 n^2+6 n^3\right )} \] Input:
Integrate[(c + d*x^n)^2/(a + b*x^n)^2,x]
Output:
(x*(-2*a*(1 + 6*n + 11*n^2 + 6*n^3)*(c^2*(1 + n)^3 + 2*c*d*(1 + 3*n + 4*n^ 2 + n^3)*x^n + d^2*(1 + n)^3*x^(2*n))*HurwitzLerchPhi[-((b*x^n)/a), 1, 1 + n^(-1)] + a*(1 + 6*n + 11*n^2 + 6*n^3)*(c^2*(1 + 2*n)^3 + 2*c*d*(1 + 2*n) ^3*x^n + d^2*(1 + 6*n + 10*n^2 + 6*n^3)*x^(2*n))*HurwitzLerchPhi[-((b*x^n) /a), 1, 2 + n^(-1)] + a*c^2*HurwitzLerchPhi[-((b*x^n)/a), 1, n^(-1)] + 6*a *c^2*n*HurwitzLerchPhi[-((b*x^n)/a), 1, n^(-1)] + 9*a*c^2*n^2*HurwitzLerch Phi[-((b*x^n)/a), 1, n^(-1)] - 4*a*c^2*n^3*HurwitzLerchPhi[-((b*x^n)/a), 1 , n^(-1)] - 10*a*c^2*n^4*HurwitzLerchPhi[-((b*x^n)/a), 1, n^(-1)] + 10*a*c ^2*n^5*HurwitzLerchPhi[-((b*x^n)/a), 1, n^(-1)] + 12*a*c^2*n^6*HurwitzLerc hPhi[-((b*x^n)/a), 1, n^(-1)] + 2*a*c*d*x^n*HurwitzLerchPhi[-((b*x^n)/a), 1, n^(-1)] + 12*a*c*d*n*x^n*HurwitzLerchPhi[-((b*x^n)/a), 1, n^(-1)] + 22* a*c*d*n^2*x^n*HurwitzLerchPhi[-((b*x^n)/a), 1, n^(-1)] + 12*a*c*d*n^3*x^n* HurwitzLerchPhi[-((b*x^n)/a), 1, n^(-1)] + a*d^2*x^(2*n)*HurwitzLerchPhi[- ((b*x^n)/a), 1, n^(-1)] + 6*a*d^2*n*x^(2*n)*HurwitzLerchPhi[-((b*x^n)/a), 1, n^(-1)] + 11*a*d^2*n^2*x^(2*n)*HurwitzLerchPhi[-((b*x^n)/a), 1, n^(-1)] + 6*a*d^2*n^3*x^(2*n)*HurwitzLerchPhi[-((b*x^n)/a), 1, n^(-1)] - 2*b*c^2* n^6*x^n*HypergeometricPFQ[{2, 2, 2, 1 + n^(-1)}, {1, 1, 4 + n^(-1)}, -((b* x^n)/a)] - 4*b*c*d*n^6*x^(2*n)*HypergeometricPFQ[{2, 2, 2, 1 + n^(-1)}, {1 , 1, 4 + n^(-1)}, -((b*x^n)/a)] - 2*b*d^2*n^6*x^(3*n)*HypergeometricPFQ[{2 , 2, 2, 1 + n^(-1)}, {1, 1, 4 + n^(-1)}, -((b*x^n)/a)]))/(2*a^3*n^4*(1 ...
Time = 0.47 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.02, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {930, 913, 778}
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 {\left (c+d x^n\right )^2}{\left (a+b x^n\right )^2} \, dx\) |
\(\Big \downarrow \) 930 |
\(\displaystyle \frac {\int \frac {c (a d-b c (1-n))-d (b c-a d (n+1)) x^n}{b x^n+a}dx}{a b n}+\frac {x (b c-a d) \left (c+d x^n\right )}{a b n \left (a+b x^n\right )}\) |
\(\Big \downarrow \) 913 |
\(\displaystyle \frac {-\frac {(b c-a d) (b c (1-n)-a d (n+1)) \int \frac {1}{b x^n+a}dx}{b}-\frac {d x (b c-a d (n+1))}{b}}{a b n}+\frac {x (b c-a d) \left (c+d x^n\right )}{a b n \left (a+b x^n\right )}\) |
\(\Big \downarrow \) 778 |
\(\displaystyle \frac {-\frac {x (b c-a d) (b c (1-n)-a d (n+1)) \operatorname {Hypergeometric2F1}\left (1,\frac {1}{n},1+\frac {1}{n},-\frac {b x^n}{a}\right )}{a b}-\frac {d x (b c-a d (n+1))}{b}}{a b n}+\frac {x (b c-a d) \left (c+d x^n\right )}{a b n \left (a+b x^n\right )}\) |
Input:
Int[(c + d*x^n)^2/(a + b*x^n)^2,x]
Output:
((b*c - a*d)*x*(c + d*x^n))/(a*b*n*(a + b*x^n)) + (-((d*(b*c - a*d*(1 + n) )*x)/b) - ((b*c - a*d)*(b*c*(1 - n) - a*d*(1 + n))*x*Hypergeometric2F1[1, n^(-1), 1 + n^(-1), -((b*x^n)/a)])/(a*b))/(a*b*n)
Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[a^p*x*Hypergeometric2F 1[-p, 1/n, 1/n + 1, (-b)*(x^n/a)], x] /; FreeQ[{a, b, n, p}, x] && !IGtQ[p , 0] && !IntegerQ[1/n] && !ILtQ[Simplify[1/n + p], 0] && (IntegerQ[p] || GtQ[a, 0])
Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Si mp[d*x*((a + b*x^n)^(p + 1)/(b*(n*(p + 1) + 1))), x] - Simp[(a*d - b*c*(n*( p + 1) + 1))/(b*(n*(p + 1) + 1)) Int[(a + b*x^n)^p, x], x] /; FreeQ[{a, b , c, d, n, p}, x] && NeQ[b*c - a*d, 0] && NeQ[n*(p + 1) + 1, 0]
Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[(a*d - c*b)*x*(a + b*x^n)^(p + 1)*((c + d*x^n)^(q - 1)/(a*b*n*(p + 1))), x] - Simp[1/(a*b*n*(p + 1)) Int[(a + b*x^n)^(p + 1)*(c + d*x^n)^(q - 2)*Simp[c*(a*d - c*b*(n*(p + 1) + 1)) + d*(a*d*(n*(q - 1) + 1) - b*c*(n*( p + q) + 1))*x^n, x], x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] && GtQ[q, 1] && IntBinomialQ[a, b, c, d, n, p, q, x]
\[\int \frac {\left (c +d \,x^{n}\right )^{2}}{\left (a +b \,x^{n}\right )^{2}}d x\]
Input:
int((c+d*x^n)^2/(a+b*x^n)^2,x)
Output:
int((c+d*x^n)^2/(a+b*x^n)^2,x)
\[ \int \frac {\left (c+d x^n\right )^2}{\left (a+b x^n\right )^2} \, dx=\int { \frac {{\left (d x^{n} + c\right )}^{2}}{{\left (b x^{n} + a\right )}^{2}} \,d x } \] Input:
integrate((c+d*x^n)^2/(a+b*x^n)^2,x, algorithm="fricas")
Output:
integral((d^2*x^(2*n) + 2*c*d*x^n + c^2)/(b^2*x^(2*n) + 2*a*b*x^n + a^2), x)
\[ \int \frac {\left (c+d x^n\right )^2}{\left (a+b x^n\right )^2} \, dx=\int \frac {\left (c + d x^{n}\right )^{2}}{\left (a + b x^{n}\right )^{2}}\, dx \] Input:
integrate((c+d*x**n)**2/(a+b*x**n)**2,x)
Output:
Integral((c + d*x**n)**2/(a + b*x**n)**2, x)
\[ \int \frac {\left (c+d x^n\right )^2}{\left (a+b x^n\right )^2} \, dx=\int { \frac {{\left (d x^{n} + c\right )}^{2}}{{\left (b x^{n} + a\right )}^{2}} \,d x } \] Input:
integrate((c+d*x^n)^2/(a+b*x^n)^2,x, algorithm="maxima")
Output:
-(a^2*d^2*(n + 1) - b^2*c^2*(n - 1) - 2*a*b*c*d)*integrate(1/(a*b^3*n*x^n + a^2*b^2*n), x) + (a*b*d^2*n*x*x^n + (a^2*d^2*(n + 1) + b^2*c^2 - 2*a*b*c *d)*x)/(a*b^3*n*x^n + a^2*b^2*n)
\[ \int \frac {\left (c+d x^n\right )^2}{\left (a+b x^n\right )^2} \, dx=\int { \frac {{\left (d x^{n} + c\right )}^{2}}{{\left (b x^{n} + a\right )}^{2}} \,d x } \] Input:
integrate((c+d*x^n)^2/(a+b*x^n)^2,x, algorithm="giac")
Output:
integrate((d*x^n + c)^2/(b*x^n + a)^2, x)
Timed out. \[ \int \frac {\left (c+d x^n\right )^2}{\left (a+b x^n\right )^2} \, dx=\int \frac {{\left (c+d\,x^n\right )}^2}{{\left (a+b\,x^n\right )}^2} \,d x \] Input:
int((c + d*x^n)^2/(a + b*x^n)^2,x)
Output:
int((c + d*x^n)^2/(a + b*x^n)^2, x)
\[ \int \frac {\left (c+d x^n\right )^2}{\left (a+b x^n\right )^2} \, dx=\frac {x^{n} \left (\int \frac {x^{2 n}}{x^{2 n} b^{2} n +x^{2 n} b^{2}+2 x^{n} a b n +2 x^{n} a b +a^{2} n +a^{2}}d x \right ) a^{2} b \,d^{2} n^{2}+2 x^{n} \left (\int \frac {x^{2 n}}{x^{2 n} b^{2} n +x^{2 n} b^{2}+2 x^{n} a b n +2 x^{n} a b +a^{2} n +a^{2}}d x \right ) a^{2} b \,d^{2} n +x^{n} \left (\int \frac {x^{2 n}}{x^{2 n} b^{2} n +x^{2 n} b^{2}+2 x^{n} a b n +2 x^{n} a b +a^{2} n +a^{2}}d x \right ) a^{2} b \,d^{2}-2 x^{n} \left (\int \frac {x^{2 n}}{x^{2 n} b^{2} n +x^{2 n} b^{2}+2 x^{n} a b n +2 x^{n} a b +a^{2} n +a^{2}}d x \right ) a \,b^{2} c d n -2 x^{n} \left (\int \frac {x^{2 n}}{x^{2 n} b^{2} n +x^{2 n} b^{2}+2 x^{n} a b n +2 x^{n} a b +a^{2} n +a^{2}}d x \right ) a \,b^{2} c d -x^{n} \left (\int \frac {x^{2 n}}{x^{2 n} b^{2} n +x^{2 n} b^{2}+2 x^{n} a b n +2 x^{n} a b +a^{2} n +a^{2}}d x \right ) b^{3} c^{2} n^{2}+x^{n} \left (\int \frac {x^{2 n}}{x^{2 n} b^{2} n +x^{2 n} b^{2}+2 x^{n} a b n +2 x^{n} a b +a^{2} n +a^{2}}d x \right ) b^{3} c^{2}+2 x^{n} a c d x +x^{n} b \,c^{2} n x -x^{n} b \,c^{2} x +\left (\int \frac {x^{2 n}}{x^{2 n} b^{2} n +x^{2 n} b^{2}+2 x^{n} a b n +2 x^{n} a b +a^{2} n +a^{2}}d x \right ) a^{3} d^{2} n^{2}+2 \left (\int \frac {x^{2 n}}{x^{2 n} b^{2} n +x^{2 n} b^{2}+2 x^{n} a b n +2 x^{n} a b +a^{2} n +a^{2}}d x \right ) a^{3} d^{2} n +\left (\int \frac {x^{2 n}}{x^{2 n} b^{2} n +x^{2 n} b^{2}+2 x^{n} a b n +2 x^{n} a b +a^{2} n +a^{2}}d x \right ) a^{3} d^{2}-2 \left (\int \frac {x^{2 n}}{x^{2 n} b^{2} n +x^{2 n} b^{2}+2 x^{n} a b n +2 x^{n} a b +a^{2} n +a^{2}}d x \right ) a^{2} b c d n -2 \left (\int \frac {x^{2 n}}{x^{2 n} b^{2} n +x^{2 n} b^{2}+2 x^{n} a b n +2 x^{n} a b +a^{2} n +a^{2}}d x \right ) a^{2} b c d -\left (\int \frac {x^{2 n}}{x^{2 n} b^{2} n +x^{2 n} b^{2}+2 x^{n} a b n +2 x^{n} a b +a^{2} n +a^{2}}d x \right ) a \,b^{2} c^{2} n^{2}+\left (\int \frac {x^{2 n}}{x^{2 n} b^{2} n +x^{2 n} b^{2}+2 x^{n} a b n +2 x^{n} a b +a^{2} n +a^{2}}d x \right ) a \,b^{2} c^{2}+a \,c^{2} n x +a \,c^{2} x}{a^{2} \left (x^{n} b n +x^{n} b +a n +a \right )} \] Input:
int((c+d*x^n)^2/(a+b*x^n)^2,x)
Output:
(x**n*int(x**(2*n)/(x**(2*n)*b**2*n + x**(2*n)*b**2 + 2*x**n*a*b*n + 2*x** n*a*b + a**2*n + a**2),x)*a**2*b*d**2*n**2 + 2*x**n*int(x**(2*n)/(x**(2*n) *b**2*n + x**(2*n)*b**2 + 2*x**n*a*b*n + 2*x**n*a*b + a**2*n + a**2),x)*a* *2*b*d**2*n + x**n*int(x**(2*n)/(x**(2*n)*b**2*n + x**(2*n)*b**2 + 2*x**n* a*b*n + 2*x**n*a*b + a**2*n + a**2),x)*a**2*b*d**2 - 2*x**n*int(x**(2*n)/( x**(2*n)*b**2*n + x**(2*n)*b**2 + 2*x**n*a*b*n + 2*x**n*a*b + a**2*n + a** 2),x)*a*b**2*c*d*n - 2*x**n*int(x**(2*n)/(x**(2*n)*b**2*n + x**(2*n)*b**2 + 2*x**n*a*b*n + 2*x**n*a*b + a**2*n + a**2),x)*a*b**2*c*d - x**n*int(x**( 2*n)/(x**(2*n)*b**2*n + x**(2*n)*b**2 + 2*x**n*a*b*n + 2*x**n*a*b + a**2*n + a**2),x)*b**3*c**2*n**2 + x**n*int(x**(2*n)/(x**(2*n)*b**2*n + x**(2*n) *b**2 + 2*x**n*a*b*n + 2*x**n*a*b + a**2*n + a**2),x)*b**3*c**2 + 2*x**n*a *c*d*x + x**n*b*c**2*n*x - x**n*b*c**2*x + int(x**(2*n)/(x**(2*n)*b**2*n + x**(2*n)*b**2 + 2*x**n*a*b*n + 2*x**n*a*b + a**2*n + a**2),x)*a**3*d**2*n **2 + 2*int(x**(2*n)/(x**(2*n)*b**2*n + x**(2*n)*b**2 + 2*x**n*a*b*n + 2*x **n*a*b + a**2*n + a**2),x)*a**3*d**2*n + int(x**(2*n)/(x**(2*n)*b**2*n + x**(2*n)*b**2 + 2*x**n*a*b*n + 2*x**n*a*b + a**2*n + a**2),x)*a**3*d**2 - 2*int(x**(2*n)/(x**(2*n)*b**2*n + x**(2*n)*b**2 + 2*x**n*a*b*n + 2*x**n*a* b + a**2*n + a**2),x)*a**2*b*c*d*n - 2*int(x**(2*n)/(x**(2*n)*b**2*n + x** (2*n)*b**2 + 2*x**n*a*b*n + 2*x**n*a*b + a**2*n + a**2),x)*a**2*b*c*d - in t(x**(2*n)/(x**(2*n)*b**2*n + x**(2*n)*b**2 + 2*x**n*a*b*n + 2*x**n*a*b...