Let $f(n)$ be the cost of computation of the LU analysis of a mtarix $A\in \mathbb{R}^{n\times n}$ and let $g(n)$ nbe the cost of the computation of the solution of a linear system, given the LU analysis of $A$.
I want to calculate the computation cost of $A^{-3}c$, where $c\in \mathbb{R}^n$.
$$$$
I have done the following:
We have that $A=LU$ where $L$ is a lower and $U$ an upper triangular matrix, correct?
Let $y$ be the solution, i.e. $$A^{-3}c=y \Rightarrow A^3y=c \Rightarrow LULULUy = c$$
We hve to solve $6$ linear systems: $$L\left (U\left (L\left (U\left (L\left (Uy\right ) \right ) \right ) \right ) \right ) = c$$
Therefore, we apply once the LU decomposition of $A$ and so we have the cost $f(n)$ and we solve $6$ times a linear system and so we get additional the cost $6g(n)$.
So, in total we have the cost $f(n)+6g(n)$.
$$$$
Is that correct?