Finding the equation of a straight line joining the origin and the point of intersection of two straight lines Question:
Find the equation of the straight line joining the origin and the point of intersection of the straight lines $\frac{x}{a}+\frac{y}{b}=1...(i)$ & $\frac{x}{b}+\frac{y}{a}=1...(ii)$ (Answer: $x-y=0$)
My attempt:
Rewriting (i) and (ii) as (iii) and (iv) in slope-intercept form respectively:-
$y=\frac{-b}{a}x+b...(iii)$
$y=\frac{-a}{b}x+a...(iv)$
Now, from (iii) and (iv),
$$\frac{-b}{a}x+b=\frac{-a}{b}x+a$$
$$\implies x(\frac{a}{b}-\frac{b}{a})=a-b$$
$$\implies x=\frac{ab(a-b)}{a^2-b^2}...(v)$$
Rewriting (i) & (ii) as (vi) & (vii) respectively,
$x=-\frac{a}{b}y+a...(vi)$
$x=-\frac{b}{a}y+b...(vii)$
Now, from (vi) & (vii),
$$-\frac{a}{b}y+a=-\frac{b}{a}y+b$$
$$\implies y(\frac{b}{a}-\frac{a}{b})=b-a$$
$$\implies y=\frac{ab(b-a)}{b^2-a^2}...(viii)$$
$$\implies y=\frac{ab(a-b)}{a^2-b^2}...(viii)$$
Now, the straight line formed by $(0,0)$ & $(\frac{ab(a-b)}{a^2-b^2}, \frac{ab(a-b)}{a^2-b^2}$ if $(x,y)$ is a point on that line,
$$\frac{y-0}{x-0}=\frac{\frac{ab(a-b)}{a^2-b^2}-0}{\frac{ab(a-b)}{a^2-b^2}-0}$$
$$\implies x=y$$
$$\implies x-y=0$$
So, I was able to get at the correct answer, but is my process valid? In (v) & (viii), for example, I divided by $(a^2-b^2)$, and I assumed that $a^2-b^2\neq0$. Was this assumption of mine correct? Is there an alternative way to do this problem that is quicker to do and that doesn't include dividing by ($a^2-b^2$)?

Yes you work is correct but it will be good to state in the beginning that the lines intersect only if $a \ne b$. For $a = b$, both equations in fact represent the same line.
You can also simplify your work a bit. Say, the intersection point is $(x_1, y_1)$. Then you have,
$\frac{x_1}{a}+\frac{y_1}{b}=1...(i)$
$\frac{x_1}{b}+\frac{y_1}{a}=1...(ii)$
From $(i)$ and $(ii)$, $\frac{x_1}{a}+\frac{y_1}{b} = \frac{x_1}{b}+\frac{y_1}{a}$
$x_1 (\frac{1}{a} - \frac{1}{b}) = y_1 (\frac{1}{a} - \frac{1}{b})$
If $a \ne b$, you have $~ y_1 = x_1$
So the equation of line passing through the origin and intersection of the given lines is,
$(y-0) = \frac{y_1 - 0}{x_1 - 0} ~ (x-0) ~ $ or $ ~ y = x$
