I'm trying to find the values of a and b in the following situation: https://i.stack.imgur.com/YxavX.jpg
I can get the correct answer using trigonometry, but I was wondering why the following solution does not give a correct result:
$$ a = 15 * \frac{35}{38+35}$$ $$ b = 15 * \frac{38}{38+35}$$
Is it because the length of the side of a triangle (a, b) isn't directly proportional to the angle (35°, 38°)?
Yes, that's correct. Considering an extreme case, if one angle were $90º$, $a$ would be infinitely long whereas the incorrect method would be a fraction of $15$.
$a$ and $b$ are correctly related to each other by the extended angle bisector theorem, which works even if the triangles are not right-angled. In your case, this would be:
$$\frac{a}{b} = \frac{x \sin 35º}{y \sin 38º}$$
but this is not the right method unless you know $x,y$ beforehand.
For this question, you would need to equate the common side as follows: $\frac{a}{\tan 35º} = \frac{b}{\tan 38º}$, which I presume is what you did. Finding one variable in terms of the other and using the fact that $a+b=15$ gives you $a,b$.