# Solving two sparse linear systems one is the transpose of the other

**URL:** <https://discourse.julialang.org/t/solving-two-sparse-linear-systems-one-is-the-transpose-of-the-other/63984>\
**Category:** Numerics\
**Tags:** linearalgebra, sparse\
**Created:** [July 3, 2021, 11:53am UTC](https://discourse.julialang.org/t/solving-two-sparse-linear-systems-one-is-the-transpose-of-the-other/63984 "2021-07-03T11:53:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohamed\_AbdElrahman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mohamed_abdelrahman/32/8112_2.png) [@Mohamed\_AbdElrahman](https://discourse.julialang.org/u/Mohamed_AbdElrahman)\
**Post date:** [July 3, 2021, 11:53am UTC](https://discourse.julialang.org/t/solving-two-sparse-linear-systems-one-is-the-transpose-of-the-other/63984/1 "2021-07-03T11:53:19Z")

</div>

I’m solving two sparse linear systems (A^T) \* x\_1 = b\_1 and A \* x\_2 = b\_2.  
where A^T is the transpose of A and b\_1, b\_2 are different.  
With a direct LU solver. How can I factorize once and use it to solve the two linear systems.

---

<div class="post-metadata">

**Author:** ![fgerick](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fgerick/32/13228_2.png) [@fgerick](https://discourse.julialang.org/u/fgerick)\
**Post date:** [July 3, 2021, 1:04pm UTC](https://discourse.julialang.org/t/solving-two-sparse-linear-systems-one-is-the-transpose-of-the-other/63984/2 "2021-07-03T13:04:45Z")

</div>

you can use

```julia
p = lu(A)
pt = p'
x_1 = pt\b_1
x_2 = p\b_2

```

---

<div class="post-metadata">

**Author:** ![Mohamed\_AbdElrahman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mohamed_abdelrahman/32/8112_2.png) [@Mohamed\_AbdElrahman](https://discourse.julialang.org/u/Mohamed_AbdElrahman)\
**Post date:** [July 3, 2021, 7:02pm UTC](https://discourse.julialang.org/t/solving-two-sparse-linear-systems-one-is-the-transpose-of-the-other/63984/3 "2021-07-03T19:02:59Z")

</div>

thank you 🙂
