A conceptual dilemma in pseudo force I am facing a very serious conceptual problem regarding pseudo forces.

Say we have this body in an accelerating frame of reference.
We analyse it from that frame
$P$ is the Pseudo force.
$T$ is the Tension (in blue) which has been broken into two components: $T_y$ (white) and $T_x$ (pink).
a is the relative accelration of the body wrt moving frame of reference.
I want to write an equation for motion along X-axis.
Will we write:
$T_x-P=mA_x$ or
$\left(A_x-\frac{P}{m}\right)m=T_x$
Clearly they give different expressions.
Please someone clarify the concept
 A: Consider the non-inertial frame moving with the body of mass $m$ such that the body is at rest in that frame.  In this frame, in addition to the force of tension there is a pseudo-force $-m \vec a$ on the body to maintain the body at rest in this non-inertial moving frame.  Let $T_x$ and $T_y$ be the components of tension in the horizontal and vertical directions, respectively.  Let $a_x$ and $a_y$ be the components of the acceleration of the body in the inertial frame. In the moving non-inertial frame the total force is zero since the body is at rest. So in that frame $T_x - ma_x = 0$ and $T_y - ma_y = 0$.
If the non-inertial frame is not fixed to the accelerating body, let $\vec a_f$ be the acceleration of the frame.  Then, in that frame $T_x - ma_{fx} = ma_{x \enspace in \enspace frame}$ and $T_{fy} - ma_{fy} = ma_{y \enspace in \enspace frame}$ where $a_{x \enspace in \enspace frame}$ and $a_{y \enspace in \enspace frame}$ are the horizontal and vertical components of the acceleration of the body in this frame.
The motion of a body in a non-inertial (accelerating) frame must include the pesudo-forces (fictitious forces) on the body as well as the net force on the body in the inertial frame.
A very good development of motion in moving coordinate systems is given in the text Mechanics by Symon, where both rotational and/or translational motion is considered.
A: An easy way to determine the equations of motion in a non-inertial reference frame is to apply the chain rule to the (relatively simple) equations of motion in an inertial reference frame.
In the inertial reference frame, the equation of motion for the system you describe is (probably)
\begin{align*}
\frac{d}{dt} \vec p = \frac{d}{dt}(m \dot{\vec{x}}) = \vec T
\end{align*}
The coordinates $\vec \xi$ of the non-inertial reference frame are related to those of the inertial frame $\vec x$ by the equation $\vec \xi + \frac{1}{2}\vec a t^2 + \vec v_0 t = \vec x$, assuming there is no rotation and that the relative acceleration and initial velocity are $\vec a$ and $\vec v_0$ respectively.
With the above assumptions, $\dot{\vec{x}} = \dot{\vec{\xi}} + \vec a t + \vec v_0$, and $\ddot{\vec{x}} = \ddot{\vec{\xi}} + \vec a$, and so
\begin{align*}
m\ddot{\vec{x}} = m(\ddot{\vec{\xi}} + \vec a) = \vec T,
\end{align*}
or
\begin{align*}
m\ddot{\vec\xi} = \vec T - m\vec a
\end{align*}
Here it would be natural to refer to $m\ddot{\vec{\xi}}$ as the "pseudo-force" because it includes fictitious forces associated with the nonzero acceleration.  In a rotating reference frame, such as that of any observer stationary with respect to the surface of the Earth, these fictitious forces also depend on the pseudo-velocity (somewhat like the velocity dependent forces that come up in electromagnetism), and can be used to infer one's distance to the axis of rotation.
