# How to solve nonlinear equations?

**URL:** https://discourse.julialang.org/t/how-to-solve-nonlinear-equations/80426
**Category:** New to Julia
**Tags:** question
**Created:** [May 3, 2022, 1:39pm UTC](https://discourse.julialang.org/t/how-to-solve-nonlinear-equations/80426 "2022-05-03T13:39:34Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![tugce](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tugce/32/37531_2.png) [@tugce](https://discourse.julialang.org/u/tugce)
#### Post date: [May 3, 2022, 1:39pm UTC](https://discourse.julialang.org/t/how-to-solve-nonlinear-equations/80426/1 "2022-05-03T13:39:34Z")

</div>

I am trying to find the y variable in this problem: H = 0.5\*(x^2+y^2)+y\*x^2-(y^3)/3. H values change between 1/20:1/2, and x values change -2:2. I tried to calculate every y value in these conditions but I couldn’t. How can I solve it?

---

<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: [May 3, 2022, 1:42pm UTC](https://discourse.julialang.org/t/how-to-solve-nonlinear-equations/80426/2 "2022-05-03T13:42:47Z")

</div>

That’s just a (cubic) polynomial in y, so you could use any package for polynomial roots, e.g. [PolynomialRoots.jl](https://github.com/giordano/PolynomialRoots.jl) or [Polynomials.jl](https://github.com/JuliaMath/Polynomials.jl).

---

<div class="post-metadata">

### Author: ![ctkelley](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ctkelley/32/10684_2.png) [@ctkelley](https://discourse.julialang.org/u/ctkelley)
#### Post date: [May 3, 2022, 1:59pm UTC](https://discourse.julialang.org/t/how-to-solve-nonlinear-equations/80426/3 "2022-05-03T13:59:30Z")

</div>

There’s always the old-fashioned way

[https://math.vanderbilt.edu/schectex/courses/cubic/](https://math.vanderbilt.edu/schectex/courses/cubic/)

---

<div class="post-metadata">

### Author: ![tugce](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tugce/32/37531_2.png) [@tugce](https://discourse.julialang.org/u/tugce)
#### Post date: [May 7, 2022, 4:11pm UTC](https://discourse.julialang.org/t/how-to-solve-nonlinear-equations/80426/4 "2022-05-07T16:11:00Z")

</div>

Thank you, these were useful for me. I understood my problem better.
