def _solveX(L, U, b):
    """Use forward and backwards substitution to calculate the x vector to solve the linear system of equations.


Parameters
----------
L: numpy.arrays
    Lower triangular matrix
U: numpy.arrays
    Upper triangular matrix
b: numpy.array
    Column vector of constant terms

Returns
-------
x: numpy.array
    Solution vector

"""
    m, n = L.shape
    # Forward Substitution
    y = list()
    y.insert(0, b[0]/L[0][0])
    for i in range(1, m):
        summ = 0
        for k in range(0, i):
            summ += L[i][k]*y[k]
        y.insert(i, (b[i]-summ)/(L[i][i]))

    # Backwards Substitution
    x = [0]*m
    x[m-1] = y[m-1] / U[m-1][m-1]
    for i in range(m - 2, -1, -1):
        summ = 0
        for k in range(i+1, n):
            summ += U[i][k]*x[k]
        x[i] = (y[i] - summ)/U[i][i]

    return x