find the value a1 for an arithmetic sequence if the sum of 9 terms is 45 and the last term is 6

Step 1:
[tex]\begin{gathered} \text{Given datas:} \\ S_9=Sum_{}_{}of\text{ nine terms=45} \\ L=\text{ last term=}6 \\ n=\text{ number of terms=6} \\ a_{1=}first\text{ term=?} \end{gathered}[/tex]Step2: Using the formula below to solve for a1
[tex]\begin{gathered} S_n=\text{ }\frac{n}{2}(a_1+L) \\ 45=\frac{9}{2}(a_1+6) \\ \text{Cross multiply,} \\ 45\ast2=9(a_1+6) \\ 90=9(a_1+6) \\ \text{Divide both sides by 9} \\ \frac{90}{9}=\frac{9}{9}(a_1+6_{}) \\ 10=1(a_1+6) \\ 10=a_1+6 \\ \text{Collect like terms} \\ a_1=10-6 \\ a_1=4 \end{gathered}[/tex]Hence the value of a1 is 4
The answer is D