# How to learn how to solve equations in Julia 1.0?

**URL:** <https://discourse.julialang.org/t/how-to-learn-how-to-solve-equations-in-julia-1-0/15738>\
**Category:** New to Julia\
**Tags:** optimization\
**Created:** [October 1, 2018, 2:14pm UTC](https://discourse.julialang.org/t/how-to-learn-how-to-solve-equations-in-julia-1-0/15738 "2018-10-01T14:14:41Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Post date:** [October 1, 2018, 6:59pm UTC](https://discourse.julialang.org/t/how-to-learn-how-to-solve-equations-in-julia-1-0/15738/7 "2018-10-01T18:59:00Z")

</div>

For functions of a single variable, the simplest solution is the Roots.jl package:

```julia
julia> ]add Roots

julia> using Roots

julia> f(p) = 1 / ((1 + p) ^ 30) * 10000 - 100
f (generic function with 1 method)

julia> find_zero(f, 1.0)
0.16591440117983175

julia> find_zero(f, -3.0)
-2.165914401179832

julia> find_zeros(f, -1000, 1000)
2-element Array{Float64,1}:
 -2.1659144011798315
  0.16591440117983178

```

You can also use the `IntervalRootFinding` package, which guarantees (in the best cases) to find all roots and guarantee that they are unique within the respective found intervals:

```julia
julia> using IntervalArithmetic, IntervalRootFinding
WARNING: using IntervalRootFinding.Bisection in module Main conflicts with an existing identifier.

julia> roots(f, -∞..∞)
2-element Array{Root{Interval{Float64}},1}:
 Root([0.165914, 0.165915], :unique)
 Root([-2.16592, -2.16591], :unique)

```

---

_[View the full topic](https://discourse.julialang.org/t/how-to-learn-how-to-solve-equations-in-julia-1-0/15738)._
