Consider an invertible matrix $P\in\mathbb{R}^{n\times n}$ and two vectors $x,y\in\mathbb{R}^n$ ($P,x,y$ are given). Now consider the following two problem.
- Problem 1: Find a matrix $R\in\mathbb{R}^{n\times n}$ (if it exists) such that $(R^TPR-P)x=y$.
- Problem 2: Find a matrix $R\in\mathbb{R}^{n\times n}$ (if it exists) such that $PRx = y$
Lately I've been encountering problems of this type. I've been trying to use some vectorization tricks without any success. I wanted to see how would you solve these equations so I can make a general idea of what would be the general strategy if it exists.
I don't think there are any general strategies. As shown by the answer below, the methods for solving your two problems are quite different.
Problem 1. I suppose $n\ge2$. Rewrite the equation as $R^TPRx=z$ where $z=Px+y$. Clearly it is not solvable when $x=0\ne z$. On the other hand, when $z=0$, an obvious solution is given by $R=0$.
Now suppose $x$ and $z$ are both nonzero. By absorbing some constant into $P$, we may assume that $x$ and $z$ are unit vectors. From $R^TPRx=z$, we obtain $x^TR^T(P+P^T)Rx=2x^Tz$. Hence the equation is solvable only if one of the following conditions is satisfied:
We will show that these conditions are also sufficient. Since the third case reduces to the second one when we negate both $P$ and $x$, we shall omit it.
Problem 2. If $x=0$, every matrix $R$ is a solution when $y=0$ and the equation is insolvable otherwise. If $x\ne0$, just pick any matrix $R$ such that $Rx=P^{-1}y$. As noted by the other answer, one particularly simple solution is given by the rank-one matrix $R=P^{-1}y\frac{x^T}{x^Tx}$.