Comment
Comment by xaedes
Taking the inverse of a matrix only solves problems which can be described in a specific way. There are situations where you want to optimize an arbitrary function.
Also taking the inverse of a matrix isn't always easy. For example for very large matrices.
The are also problems where the optimal solution changes over time (e.g. trajectory following control). This gives a good guess for the solution at each timestep(t>0) and improving that with gradient descent can be more performant than completely solving for a matrix inverse each time.