# Root finding with zero lower bound

**URL:** <https://discourse.julialang.org/t/root-finding-with-zero-lower-bound/104970>\
**Category:** General Usage\
**Tags:** newton-raphson, rootfinding\
**Created:** [October 15, 2023, 1:26am UTC](https://discourse.julialang.org/t/root-finding-with-zero-lower-bound/104970 "2023-10-15T01:26:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JakeWren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jakewren/32/202475_2.png) [@JakeWren](https://discourse.julialang.org/u/JakeWren)\
**Post date:** [October 15, 2023, 1:26am UTC](https://discourse.julialang.org/t/root-finding-with-zero-lower-bound/104970/1 "2023-10-15T01:26:22Z")

</div>

Hi,

I want to use:  
`find_zero((f,fp), x_{0}, Roots.Newton())`  
for root finding. However, my domain is non-negative. Is there a way to impose this?  
Thanks!

---

<div class="post-metadata">

**Author:** ![longemen3000](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/longemen3000/32/7298_2.png) [@longemen3000](https://discourse.julialang.org/u/longemen3000)\
**Post date:** [October 15, 2023, 7:00am UTC](https://discourse.julialang.org/t/root-finding-with-zero-lower-bound/104970/2 "2023-10-15T07:00:00Z")

</div>

maybe a transformation?

```julia
using Roots
f(x) = log(x) - 3 #solution at f(x) = 0 at x = exp(3) 
g(x) = f(x*x)
x_squared = find_zero(f,1.4)
x = sqrt(x_squared)

```

---

<div class="post-metadata">

**Author:** ![\_stla](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/_stla/32/35613_2.png) [@\_stla](https://discourse.julialang.org/u/_stla)\
**Post date:** [October 16, 2023, 11:03am UTC](https://discourse.julialang.org/t/root-finding-with-zero-lower-bound/104970/3 "2023-10-16T11:03:23Z")

</div>

Instead of using **Roots** , you can use **Optim** with the LFBGS method which allows to set bounds.
