Relationships between 2 matrices yielding values of determinants I got some homework in my school about matrix. These questions are seem so easy to solve but I always get stuck. Here they are:

  
*
  
*Let $A,B \in \mathbb{R}^{2017\times2017}$ matrices which satisfy the following equation.
  $$A^{-1} = (A+B)^{-1}-B^{-1}$$
  and $\det(A^{-1})=2017.$ Find $\det(B)$.
  

My attempt: 
\begin{equation*}
\begin{split}
(A+B)A^{-1} &= (A+B)\left[(A+B)^{-1}-B^{-1}\right] \quad \quad \text{multiplying both sides by (A+B)} \\
A^{-1}A +BA^{-1} &= (A+B)(A+B)^{-1}-(A+B)B^{-1} \\
I+BA^{-1} &= I - AB^{-1}-I\\
I+BA^{-1} &=-AB^{-1}\\
BA^{-1} +AB^{-1} +I&= O
\end{split}
\end{equation*}
then I don't know how to continue.

2.Let $A,B\in \mathbb{R}^{2017 \times 2017}$ matrices which satisfy the equation
  $$AB^{2}-2BAB+B^{2}A=O$$ What is the largest eigenvalue of $AB-BA?$

$ABB+BBA=2BAB$
$ABB+BBA=BAB+BAB$
$ABB-BAB=BAB-BBA$
$(AB-BA)B=B(AB-BA)$
what is this means?
I really need your thoughts, thanks in advance.
 A: Note that this is $A^{-1} +B^{-1}=(A+B)^{-1}$ i.e we have $$(A+B)(A^{-1} +B^{-1}) = I \implies I + AB^{-1}+BA^{-1}+I = I$$ or equivalently $$I + AB^{-1} + BA^{-1} = 0 \implies \begin{cases}B+A+BA^{-1}B = 0 \\ A + B + AB^{-1}A = 0\end{cases}$$
So $$BA^{-1}B = AB^{-1}A \implies (\det B)^3 = (\det A)^3 \implies \det B = \det A.$$
A: Pertaining to 1, interestingly enough, I don't think such $A,B$ are possible for real matrices of odd dimension. We have $A^{-1} +B^{-1}=(A+B)^{-1}$, so
$$(A+B)(A^{-1} +B^{-1}) = I,$$
$$I + AB^{-1}+BA^{-1}+I = I,$$
$$AB^{-1}+I+BA^{-1} = O.$$
Multiplying by $AB^{-1}$ on the left, we obtain
$$(AB^{-1})^2+AB^{-1}+I=O.$$
Thus the minimal polynomial for $AB^{-1}$ divides $p(x) = x^2+x+1$. However, $p$ is irreducible over $\mathbb{R}$, so $p$ must the minimal polynomial. As the minimal polynomial is irreducible quadratic, the characteristic polynomial for $AB^{-1}$ must be a power of $p$, but this isn't possible as the degree of the characteristic polynomial is $2017$ which is odd.
Edit: If we assume the dimensions of $A$ and $B$ are even, this does lead to another solution to 1. The roots of $p$ and thus the eigenvalues of $AB^{-1}$ are $\lambda_1=-\frac{1}{2}+\frac{\sqrt3}{2}i, \lambda_2=-\frac{1}{2}-\frac{\sqrt3}{2}i$. Then we have $\det AB^{-1}=\lambda_1\lambda_2=1$, so $\det A = \det B$.
A: For your second question, we are given
$$p: AB^2 - 2BAB + B^2A=0.$$
We want to show that  $AB-BA$ is nilpotent (i.e all eigenvalues of $AB-BA$ are zero.)
We will do this in four parts:
1.) show that for any linear operators $X, Y$, then $tr(XY-YX)=0;$ 
2.) show that, for the spectrum  $\left \{\lambda_1,...,\lambda_n  \right \}$ of any operator $X $, 
then, for all $k \in \Bbb{N},$ we have that
$$tr(X^k) = {\lambda_1^k+...+\lambda_n^k};$$
3.) show that $p \implies B $ commutes with $AB - BA$;
4.) show (by induction) that for our particular $A,B $ under $p $, there is an operator $X$ for each $k$ such that 
$$(AB-BA)^k = XB-BX$$
With all this we can say that for eigenvalues $\lambda_1,...,\lambda_n$ of $AB-BA$, then for all $k$ we have
$$\begin{equation}\begin{split}\lambda_1^k+...+\lambda_n^k&=tr[(AB-BA)^k] \\&= tr(XB-BX)\\& = 0\end{split}\end{equation}$$
Hence, $\lambda_i =0\: \forall i\in \left\{1,..., n \right\} $.
I'll leave you to figure out 1.) and 2.).  Below are 3.) (which you've already shown) and 4.).
Part 3.)

 \begin{equation}\begin{split} 0 &= AB^2-2BAB+B^2A\\&= AB^2 - BAB - BAB + B^2A\\&= (AB-BA)B - B(AB-BA)  \end{split} \\ \end{equation}$ \implies (AB-BA)B=B(AB-BA)$

Part 4.)

  $\text{At }k = 1, \text{then } X_1=A.    \\ \text{Assume } (AB-BA)^k=X_kB-BX_k. \text{Then} $ \begin{align}\begin{split} (AB-BA)^{k+1}& = (AB-BA)^k(AB-BA) \\ & = (X_kB-BX_k)(AB-BA) \\&=X_kB(AB-BA)-BX_k (AB-BA)\\&=X_k(AB-BA)B-BX_k(AB-BA)\\&=X_{k+1}B-BX_{k+1} \end{split} \end{align}

