\begin{aligned}x :  T − m_{A}g sin(θ) − μ_{k}F_{n} & = m_{A}a_{x} \\ y :  F_{n} − m_{A}g cos(θ) & = 0 \end{aligned}

F_{n} = m_{A}g cos(θ)

T − m_{A}g sin(θ) − μ_{k}m_{A}g cos(θ) = m_{A}a_{x}

\begin{aligned}x : 0 & = 0 \\ y : T − m_{B}g & = −m_{B}a_{y} \end{aligned}

T = m_{B}g − m_{B}a_{y}

m_{B}g − m_{B}a − m_{A}g sin(θ) − μ_{k}m_{A}g cos(θ) = m_{A}a