I am doing somework using the Thomas algoritm when is comes to solving tridiagonal matrix. However, I cant find any information regarding the computational cost of the Thomas algorithm (TA). I do know that the computational cost of TA is O(n), but I just dont know how to "prove" it or show it. My task is to compare TA to gaussian elmination with pivoting.
Is there anyway I can show that the computaional cost of TA is O(n)?
You can just count operations... Assuming you have a tridiagonal matrix with diagonal $b_1, \cdots, b_n$, sub-diagonal $a_2, \cdots, a_n$ and super-diagonal $c_1,\cdots, c_{n-1}$, the Thomas algorithm consists in computing $c', d'$ according to $$ c_1'=c_1/b_1, \quad c_i'=\frac{c_i}{b_i-a_ic_{i-1}'}, \,\, i=2,\cdots, n-1 $$
$$ d_1'=d_1/b_1, \quad d_i'=\frac{d_i-a_id_{i-1}'}{b_i-a_i c_{i+1}'}, \,\, i=2,\cdots, n $$
and then computing $x$ by back-substitution
$$ x_n = d_n',\quad x_i = d_i'-c_i'x_{i+1}, \,\, i = n-1, \cdots, 1 $$
So, counting operations you have:
So, the total operation count is $10n -11$, clearly $O(n)$, as mentioned in the comments.