My task is to solve using $LU$ decomposition $A^k x = b$ where $k$ is a positive integer.
I can raise the matrix $A$ to the power of $k$ and use $LU$ decomposition to solve the linear system $A^k x = b$. While this solution is correct, I was told that I should try to use only one $LU$ decomposition along with the identity $A^k = LU \cdots LU$. I understand this identity but do not know how to proceed.
Note that the system $A^k x = b$ can be written $LUA^{k-1}x=b$ by factoring the first matrix.
Let $n$ be the order of the matrix $A$.
Runtime. Since a forward/backward solve costs $O(n^2)$, this algorithm requires $O(n^3)$ FLOPs to perform the $LU$ factorization and $O(n^2 k)$ FLOPs to perform the $k$ forward/backward solve pairs.
Naive algorithm. Alternatively, we could have computed $A^k$ and solved the system $A^k x = b$ directly (i.e., Gaussian elimination). Taking the power naively by the divide and conquer approach requires $O(n^3 \lg k)$ FLOPs. $O(n^3)$ FLOPs are needed for Gaussian elimination.