How do I convert:

$\displaystyle tan(k+1)\theta cot\theta-k-1+tan(k+1)\theta tan(k+2)\theta$

$\displaystyle =tan(k+1)\theta[cot\theta+tan(k+2)\theta]-k-1$(As far as I could get)

Into:

$\displaystyle tan(k+2)\theta cot\theta-k-1$

Help will be appreciated big time(Thinking)Code:`Original sum:`

Use the method of induction to prove that:

$\displaystyle \displaystyle\sum_{r=1}^n tanr\theta tan(r+1)\theta=tan(n+1)\theta cot\theta-n-1 $