# Factorization using lu() and lufact()

**URL:** https://discourse.julialang.org/t/factorization-using-lu-and-lufact/102860
**Category:** New to Julia
**Created:** [August 16, 2023, 1:20pm UTC](https://discourse.julialang.org/t/factorization-using-lu-and-lufact/102860 "2023-08-16T13:20:43Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Kritika\_Verma](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kritika_verma/32/52198_2.png) [@Kritika\_Verma](https://discourse.julialang.org/u/Kritika_Verma)
#### Post date: [August 16, 2023, 1:20pm UTC](https://discourse.julialang.org/t/factorization-using-lu-and-lufact/102860/1 "2023-08-16T13:20:43Z")

</div>

I was following a tutorial on Youtube and for factorization and they used lu() and lufact(). From what I gather, I don’t have to use a specific package for it. But when I am trying to use to the functions I am getting this output:

UndefVarError: lu not defined

Stacktrace:  
[1] top-level scope  
@ In[3]:1

I am also getting the same error for det().

---

<div class="post-metadata">

### Author: ![hexaeder](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hexaeder/32/24403_2.png) [@hexaeder](https://discourse.julialang.org/u/hexaeder)
#### Post date: [August 16, 2023, 1:27pm UTC](https://discourse.julialang.org/t/factorization-using-lu-and-lufact/102860/2 "2023-08-16T13:27:46Z")

</div>

`lu` is part of the `LinearAlgebra` stdlib so you need to execute `using LinearAlgebra` first. You can find out by [searching the Julia docs for `lu`](https://docs.julialang.org/en/v1/search/?q=lu).  
Not sure about `lufact` though, does not appear in the docs.

---

<div class="post-metadata">

### Author: ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)
#### Post date: [August 16, 2023, 1:29pm UTC](https://discourse.julialang.org/t/factorization-using-lu-and-lufact/102860/3 "2023-08-16T13:29:34Z")

</div>

I believe `lufact` was the name of `lu` in Julia 0.6 (but not 100% sure)

---

<div class="post-metadata">

### Author: ![hexaeder](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hexaeder/32/24403_2.png) [@hexaeder](https://discourse.julialang.org/u/hexaeder)
#### Post date: [August 16, 2023, 1:33pm UTC](https://discourse.julialang.org/t/factorization-using-lu-and-lufact/102860/4 "2023-08-16T13:33:31Z")

</div>

yeah, looks like it has been deprecated before 1.0. [once more unto the decomposition breach, dear friends! by Sacha0 · Pull Request #27212 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/pull/27212)

In that case I’d suggest searching for a different tutorial on YouTube as that one seems to be super outdated…

---

<div class="post-metadata">

### Author: ![Kritika\_Verma](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kritika_verma/32/52198_2.png) [@Kritika\_Verma](https://discourse.julialang.org/u/Kritika_Verma)
#### Post date: [August 16, 2023, 3:04pm UTC](https://discourse.julialang.org/t/factorization-using-lu-and-lufact/102860/5 "2023-08-16T15:04:22Z")

</div>

> [@hexaeder](#):
>
> `LinearAlgebra` stdlib so you need to execute `using LinearAlgebra` first. You can find out by [searching the Julia docs for `lu`](https://docs.julialang.org/en/v1/search/?q=lu).  
> Not sure about `lufact` though, does not appear in the docs.

Thank you for clarifying. I tried using other functions too and they weren’t working either but I didn’t know they were moved to `LinearAlgebra`.

---

<div class="post-metadata">

### Author: ![Kritika\_Verma](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kritika_verma/32/52198_2.png) [@Kritika\_Verma](https://discourse.julialang.org/u/Kritika_Verma)
#### Post date: [August 16, 2023, 3:05pm UTC](https://discourse.julialang.org/t/factorization-using-lu-and-lufact/102860/6 "2023-08-16T15:05:09Z")

</div>

Oh the tutorial I was following was pretty old so that makes sense.

---

<div class="post-metadata">

### Author: ![Kritika\_Verma](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kritika_verma/32/52198_2.png) [@Kritika\_Verma](https://discourse.julialang.org/u/Kritika_Verma)
#### Post date: [August 16, 2023, 3:06pm UTC](https://discourse.julialang.org/t/factorization-using-lu-and-lufact/102860/7 "2023-08-16T15:06:22Z")

</div>

Yes, that was five years old 😅. Thank you!
