# Algebraic equation in matrix form

**URL:** <https://discourse.julialang.org/t/algebraic-equation-in-matrix-form/90621>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [November 22, 2022, 3:11am UTC](https://discourse.julialang.org/t/algebraic-equation-in-matrix-form/90621 "2022-11-22T03:11:41Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [November 22, 2022, 1:20pm UTC](https://discourse.julialang.org/t/algebraic-equation-in-matrix-form/90621/7 "2022-11-22T13:20:42Z")

</div>

> [@stevengj](#):
>
> This is a [nonlinear eigenproblem](https://en.wikipedia.org/wiki/Nonlinear_eigenproblem); there are much more efficient ways to solve it than black-box root solvers for \det A. See e.g. [NonlinearEigenproblems.jl](https://github.com/nep-pack/NonlinearEigenproblems.jl).

In fact, it’s even better than that — looking at your matrix, it’s actually a _linear_ eigenproblem in -k'^2 (assuming all of your \eta\_\ell factors are constants): if you just move the k'^2 terms to the other side, the equation you wrote takes the form Bc = -k'^2 c, so you can just use `sqrt.(.- eigvals(B))` to find the roots k'.

If your matrix is 7 \times 7 as shown in your post, you should be able to solve 1000 of these eigenproblems in a fraction of a second.

---

_[View the full topic](https://discourse.julialang.org/t/algebraic-equation-in-matrix-form/90621)._
