Let's see if I can make sense of what you've said; the grammar of the last sentence is not at all clear.
You show a right triangle with legs [MATH]4s[/MATH] and [MATH]5s[/MATH] in the picture; I suppose the numbers 4 and 5 could be any integers, which you are calling #1 and #2. Let's call them [MATH]a[/MATH] and [MATH]b[/MATH] instead, so that in the picture [MATH]a = 4[/MATH] and [MATH]b = 5[/MATH]; and I'll assume that they, too, are given, in addition to length [MATH]s[/MATH] and angle [MATH]\theta[/MATH].
The expression you wrote becomes [MATH]\frac{as}{\sin(\theta)} - \frac{bs}{\cos(\theta)}[/MATH]. Can you explain your thinking? Is this supposed to equal x?
One problem I see is that [MATH]a[/MATH] and [MATH]b[/MATH] will determine [MATH]\theta: \tan(\theta) = \frac{bs}{as} = \frac{b}{a}[/MATH]. So if [MATH]\theta[/MATH] is given, then you are assuming that its tangent is a rational number, which is not true in general. If you knew [MATH]a[/MATH] and [MATH]b[/MATH], rather than [MATH]\theta[/MATH], you could find [MATH]\theta[/MATH] from them.
Can you explain the requirements more fully?