Integrand size = 23, antiderivative size = 139 \[ \int \frac {(a-b x)^{-n} (a+b x)^{1+n}}{x^2} \, dx=-\frac {(a-b x)^{-n} (a+b x)^{1+n}}{x}+\frac {b (1+2 n) (a-b x)^{-n} (a+b x)^n \operatorname {Hypergeometric2F1}\left (1,-n,1-n,\frac {a-b x}{a+b x}\right )}{n}-\frac {2^n b (a-b x)^{-n} (a+b x)^n \left (1+\frac {b x}{a}\right )^{-n} \operatorname {Hypergeometric2F1}\left (-n,-n,1-n,\frac {a-b x}{2 a}\right )}{n} \] Output:
-(b*x+a)^(1+n)/x/((-b*x+a)^n)+b*(1+2*n)*(b*x+a)^n*hypergeom([1, -n],[1-n], (-b*x+a)/(b*x+a))/n/((-b*x+a)^n)-2^n*b*(b*x+a)^n*hypergeom([-n, -n],[1-n], 1/2*(-b*x+a)/a)/n/((-b*x+a)^n)/((1+b*x/a)^n)
Result contains higher order function than in optimal. Order 6 vs. order 5 in optimal.
Time = 0.19 (sec) , antiderivative size = 146, normalized size of antiderivative = 1.05 \[ \int \frac {(a-b x)^{-n} (a+b x)^{1+n}}{x^2} \, dx=\frac {(a-b x)^{-n} (a+b x)^n \left (-\frac {a^2 \left (1-\frac {a}{b x}\right )^n \left (1+\frac {a}{b x}\right )^{-n} \operatorname {AppellF1}\left (1,n,-n,2,\frac {a}{b x},-\frac {a}{b x}\right )}{x}+\frac {2^n b (a-b x) \left (1+\frac {b x}{a}\right )^{-n} \operatorname {AppellF1}\left (1-n,-n,1,2-n,\frac {a-b x}{2 a},1-\frac {b x}{a}\right )}{-1+n}\right )}{a} \] Input:
Integrate[(a + b*x)^(1 + n)/(x^2*(a - b*x)^n),x]
Output:
((a + b*x)^n*(-((a^2*(1 - a/(b*x))^n*AppellF1[1, n, -n, 2, a/(b*x), -(a/(b *x))])/((1 + a/(b*x))^n*x)) + (2^n*b*(a - b*x)*AppellF1[1 - n, -n, 1, 2 - n, (a - b*x)/(2*a), 1 - (b*x)/a])/((-1 + n)*(1 + (b*x)/a)^n)))/(a*(a - b*x )^n)
Time = 0.24 (sec) , antiderivative size = 151, normalized size of antiderivative = 1.09, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {138, 80, 79, 107, 141}
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 {(a-b x)^{-n} (a+b x)^{n+1}}{x^2} \, dx\) |
\(\Big \downarrow \) 138 |
\(\displaystyle a^2 \int \frac {(a-b x)^{-n-1} (a+b x)^n}{x^2}dx-b^2 \int (a-b x)^{-n-1} (a+b x)^ndx\) |
\(\Big \downarrow \) 80 |
\(\displaystyle a^2 \int \frac {(a-b x)^{-n-1} (a+b x)^n}{x^2}dx-b^2 2^n (a+b x)^n \left (\frac {a+b x}{a}\right )^{-n} \int (a-b x)^{-n-1} \left (\frac {b x}{2 a}+\frac {1}{2}\right )^ndx\) |
\(\Big \downarrow \) 79 |
\(\displaystyle a^2 \int \frac {(a-b x)^{-n-1} (a+b x)^n}{x^2}dx-\frac {b 2^n (a-b x)^{-n} (a+b x)^n \left (\frac {a+b x}{a}\right )^{-n} \operatorname {Hypergeometric2F1}\left (-n,-n,1-n,\frac {a-b x}{2 a}\right )}{n}\) |
\(\Big \downarrow \) 107 |
\(\displaystyle a^2 \left (\frac {b (2 n+1) \int \frac {(a-b x)^{-n-1} (a+b x)^n}{x}dx}{a}-\frac {(a-b x)^{-n} (a+b x)^{n+1}}{a^2 x}\right )-\frac {b 2^n (a-b x)^{-n} (a+b x)^n \left (\frac {a+b x}{a}\right )^{-n} \operatorname {Hypergeometric2F1}\left (-n,-n,1-n,\frac {a-b x}{2 a}\right )}{n}\) |
\(\Big \downarrow \) 141 |
\(\displaystyle a^2 \left (\frac {b (2 n+1) (a-b x)^{-n} (a+b x)^n \operatorname {Hypergeometric2F1}\left (1,-n,1-n,\frac {a-b x}{a+b x}\right )}{a^2 n}-\frac {(a-b x)^{-n} (a+b x)^{n+1}}{a^2 x}\right )-\frac {b 2^n (a-b x)^{-n} (a+b x)^n \left (\frac {a+b x}{a}\right )^{-n} \operatorname {Hypergeometric2F1}\left (-n,-n,1-n,\frac {a-b x}{2 a}\right )}{n}\) |
Input:
Int[(a + b*x)^(1 + n)/(x^2*(a - b*x)^n),x]
Output:
a^2*(-((a + b*x)^(1 + n)/(a^2*x*(a - b*x)^n)) + (b*(1 + 2*n)*(a + b*x)^n*H ypergeometric2F1[1, -n, 1 - n, (a - b*x)/(a + b*x)])/(a^2*n*(a - b*x)^n)) - (2^n*b*(a + b*x)^n*Hypergeometric2F1[-n, -n, 1 - n, (a - b*x)/(2*a)])/(n *(a - b*x)^n*((a + b*x)/a)^n)
Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(( a + b*x)^(m + 1)/(b*(m + 1)*(b/(b*c - a*d))^n))*Hypergeometric2F1[-n, m + 1 , m + 2, (-d)*((a + b*x)/(b*c - a*d))], x] /; FreeQ[{a, b, c, d, m, n}, x] && !IntegerQ[m] && !IntegerQ[n] && GtQ[b/(b*c - a*d), 0] && (RationalQ[m] || !(RationalQ[n] && GtQ[-d/(b*c - a*d), 0]))
Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(c + d*x)^FracPart[n]/((b/(b*c - a*d))^IntPart[n]*(b*((c + d*x)/(b*c - a*d))) ^FracPart[n]) Int[(a + b*x)^m*Simp[b*(c/(b*c - a*d)) + b*d*(x/(b*c - a*d) ), x]^n, x], x] /; FreeQ[{a, b, c, d, m, n}, x] && !IntegerQ[m] && !Integ erQ[n] && (RationalQ[m] || !SimplerQ[n + 1, m + 1])
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_) )^(p_), x_] :> Simp[b*(a + b*x)^(m + 1)*(c + d*x)^(n + 1)*((e + f*x)^(p + 1 )/((m + 1)*(b*c - a*d)*(b*e - a*f))), x] + Simp[(a*d*f*(m + 1) + b*c*f*(n + 1) + b*d*e*(p + 1))/((m + 1)*(b*c - a*d)*(b*e - a*f)) Int[(a + b*x)^(m + 1)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x ] && EqQ[Simplify[m + n + p + 3], 0] && (LtQ[m, -1] || SumSimplerQ[m, 1])
Int[(((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_))/((e_.) + (f_.)*(x _))^2, x_] :> Simp[b*(d/f^2) Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1), x], x] + Simp[(b*e - a*f)*((d*e - c*f)/f^2) Int[(a + b*x)^(m - 1)*((c + d*x) ^(n - 1)/(e + f*x)^2), x], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && IGtQ [m + n, 0] && EqQ[2*b*d*e - f*(b*c + a*d), 0]
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_) )^(p_), x_] :> Simp[(b*c - a*d)^n*((a + b*x)^(m + 1)/((m + 1)*(b*e - a*f)^( n + 1)*(e + f*x)^(m + 1)))*Hypergeometric2F1[m + 1, -n, m + 2, (-(d*e - c*f ))*((a + b*x)/((b*c - a*d)*(e + f*x)))], x] /; FreeQ[{a, b, c, d, e, f, m, p}, x] && EqQ[m + n + p + 2, 0] && ILtQ[n, 0] && (SumSimplerQ[m, 1] || !Su mSimplerQ[p, 1]) && !ILtQ[m, 0]
\[\int \frac {\left (b x +a \right )^{1+n} \left (-b x +a \right )^{-n}}{x^{2}}d x\]
Input:
int((b*x+a)^(1+n)/x^2/((-b*x+a)^n),x)
Output:
int((b*x+a)^(1+n)/x^2/((-b*x+a)^n),x)
\[ \int \frac {(a-b x)^{-n} (a+b x)^{1+n}}{x^2} \, dx=\int { \frac {{\left (b x + a\right )}^{n + 1}}{{\left (-b x + a\right )}^{n} x^{2}} \,d x } \] Input:
integrate((b*x+a)^(1+n)/x^2/((-b*x+a)^n),x, algorithm="fricas")
Output:
integral((b*x + a)^(n + 1)/((-b*x + a)^n*x^2), x)
\[ \int \frac {(a-b x)^{-n} (a+b x)^{1+n}}{x^2} \, dx=\int \frac {\left (a - b x\right )^{- n} \left (a + b x\right )^{n + 1}}{x^{2}}\, dx \] Input:
integrate((b*x+a)**(1+n)/x**2/((-b*x+a)**n),x)
Output:
Integral((a + b*x)**(n + 1)/(x**2*(a - b*x)**n), x)
\[ \int \frac {(a-b x)^{-n} (a+b x)^{1+n}}{x^2} \, dx=\int { \frac {{\left (b x + a\right )}^{n + 1}}{{\left (-b x + a\right )}^{n} x^{2}} \,d x } \] Input:
integrate((b*x+a)^(1+n)/x^2/((-b*x+a)^n),x, algorithm="maxima")
Output:
integrate((b*x + a)^(n + 1)/((-b*x + a)^n*x^2), x)
\[ \int \frac {(a-b x)^{-n} (a+b x)^{1+n}}{x^2} \, dx=\int { \frac {{\left (b x + a\right )}^{n + 1}}{{\left (-b x + a\right )}^{n} x^{2}} \,d x } \] Input:
integrate((b*x+a)^(1+n)/x^2/((-b*x+a)^n),x, algorithm="giac")
Output:
integrate((b*x + a)^(n + 1)/((-b*x + a)^n*x^2), x)
Timed out. \[ \int \frac {(a-b x)^{-n} (a+b x)^{1+n}}{x^2} \, dx=\int \frac {{\left (a+b\,x\right )}^{n+1}}{x^2\,{\left (a-b\,x\right )}^n} \,d x \] Input:
int((a + b*x)^(n + 1)/(x^2*(a - b*x)^n),x)
Output:
int((a + b*x)^(n + 1)/(x^2*(a - b*x)^n), x)
\[ \int \frac {(a-b x)^{-n} (a+b x)^{1+n}}{x^2} \, dx=\left (\int \frac {\left (b x +a \right )^{n}}{\left (-b x +a \right )^{n} x^{2}}d x \right ) a +\left (\int \frac {\left (b x +a \right )^{n}}{\left (-b x +a \right )^{n} x}d x \right ) b \] Input:
int((b*x+a)^(1+n)/x^2/((-b*x+a)^n),x)
Output:
int((a + b*x)**n/((a - b*x)**n*x**2),x)*a + int((a + b*x)**n/((a - b*x)**n *x),x)*b