I'm trying to solve below equation and creating a formula for $x$.
$$A = \arctan \left(\frac{\sin (x)}{ -\tan(f)\sin (e) + \cos (e)\cos(x) }\right)$$
where $A$ is a constant e.g. $A=5$ and $f$ and $e$ are also some given numerical values (e.g. $f=2$ and $e=3$).
So far what steps I've tried:
Given equation: $$A=\arctan \left(\frac{\sin (x)}{ -\tan(f)\sin (e) + \cos (e)\cos(x) }\right)$$
Moved atan to LHS: $$\frac{\sin (x)}{ -\tan(f)\sin (e) + \cos (e)\cos(x) } = \tan (A)$$
$\sin (x) = \tan (A) (-\tan(f)\sin (e) + \cos (e)\cos(x))$
$\sin (x) = -\tan (A)\tan(f)\sin (e) + \tan (A)\cos (e)\cos(x)$
- $\sin (x) - \tan (A)\cos (e)\cos(x) = -\tan (A)\tan(f)\sin (e)$
Got stuck now to solve further the L.H.S part (even though I know $\tan (A)\cos (e)$ would be some numerical value after putting value of $A$ and $e$ (e.g. $2.333$) i.e. $\sin (x) - 2.333 \cos(x)$.
If you have any equation of the form $a\sin(x)+b\cos(x)=k$, you can solve for $x$ by first rewriting the left side as a single sine function. The trick is this:
$$a\sin(x)+b\cos(x) = \sqrt{a^2+b^2}\sin(x+\alpha),$$
where $\alpha$ is a number satisfying: $$\sin(\alpha)=\frac{b}{\sqrt{a^2+b^2}},\,\,\,\,\, \cos(\alpha)=\frac{a}{\sqrt{a^2+b^2}}$$
After doing this, you can solve for $x$ in the usual way: divide both sides by the radical, take inverse sines, and then subtract $\alpha$. Of course, when you "take inverse sines", you'll only get a value for $x+\alpha$ that's between $-\pi/2$ and $\pi/2$ (or $-90^\circ$ and $90^\circ$), so you might have to adjust something at that point, or look at the infinite family of possible solutions. That's the usual situation, though, for any equation of the form $\sin(x)=c$
Edit: completing the solution, starting with your step 5:
\begin{align} \sin (x) - \tan (A)\cos (e)\cos(x) &= -\tan (A)\tan(f)\sin (e)\\ \frac{1}{k}\sin(x) - \frac{\tan(A)\cos(e)}{k}\cos(x)&=\frac{-\tan (A)\tan(f)\sin (e)}{k}\\ \sin(x+\alpha)&=\frac{-\tan(A)\tan(f)\sin(e)}{k}\\ x+\alpha &=\arcsin\left( \frac{-\tan(A)\tan(f)\sin(e)}{k} \right)\\ x &= \arcsin\left( \frac{-\tan(A)\tan(f)\sin(e)}{k} \right) - \alpha \end{align}
In the above, $$k=\sqrt{1+\tan^2(A)\cos^2(e)},$$ and $$\alpha = \arcsin\left(\frac{-\tan(A)\cos(e)}{k}\right)$$