TITLE: Value of an integral
QUESTION [5 upvotes]: I need to verify  the value of the following integral
$$ 4n(n-1)\int_0^1 \frac{1}{8t^3}\left[\frac{(2t-t^2)^{n+1}}{(n+1)}-\frac{t^{2n+2}}{n+1}-t^4\{\frac{(2t-t^2)^{n-1}}{n-1}-\frac{t^{2n-2}}{n-1} \} \right] dt.$$
The integrand (factor of $4n(n-1)$) included) is the pdf of certain random variable for $n\geq 3$ and hence I expect it be 1. If somebody can kindly put it into some computer algebra system like MATHEMATICA, I would be most obliged. I do not have access to any CAS software.
PS:-I do not know of any free CAS  software. If there is any somebody may please share

REPLY [23 votes]: The integral can be rewritten as
\begin{align*}
I&=\frac{n(n-1)}{2}\int_0^1\frac{t^{n-2}(2-t)^{n+1}-t^{2n-1}}{n+1}-\frac{t^n(2-t)^{n-1}-t^{2n-1}}{n-1}\,dt\\[6pt]
&=\frac{1}{2n+2}+\frac{n(n-1)}{2}\int_0^1\frac{t^{n-2}(2-t)^{n+1}}{n+1}-\frac{t^n(2-t)^{n-1}}{n-1}\,dt.
\end{align*}
Integrating by parts, we obtain
$$\int_0^1\frac{t^{n-2}(2-t)^{n+1}}{n+1}\,dt=\frac{1}{n^2-1}+\int_0^1\frac{t^{n-1}(2-t)^n}{n-1}\,dt.$$
Therefore,
\begin{align*}
I&=\frac{1}{2}+\frac{n}{2}\int_0^1t^{n-1}(2-t)^n-t^n(2-t)^{n-1}\,dt\\[6pt]
&=\frac{1}{2}+\frac{1}{2}\int_0^1(t^n(2-t)^n)'\,dt=\frac{1}{2}+\frac{1}{2}=1.
\end{align*}
P.S. You can use SageMath and WolframAlpha for symbolic calculations. Both are free.

REPLY [6 votes]: It seems your conjecture is true. Mathematica gives the result
$$
(1 + 4^n (-1 + n) n \mbox{Beta} [1/2, -1 + n, 2 + n] - 
 4^n n (1 + n) \mbox{Beta} [1/2, 1 + n, n])/(2 (1 + n))
$$
in terms of the incomplete Beta function, and putting in random integers $\geq 3$ always yields 1 (I haven't managed to get Mathematica to spit that out as a general result for arbitrary $n$).

REPLY [4 votes]: You can use CoCalc.
For instance, type
integral(x^2,x)
and get
1/3*x^3
It also permits symbolic parameters.
Input:
f(x,n)=x^2+n
integral(f(x,n),x)
Output:
1/3*x^3+n*x