# check if one expression can be transformed into another

My question is how to use Mathematica to check if one expression can be transformed into another:

Example 1: $$ax^2+bx+c$$ into $$K\cdot(x+\alpha)^2+\beta$$, and then show me $$K(a,b,c)$$ and so on.

Example 2: Say I have the Maxwell equations:

$$\nabla \cdot \mathbf{E} = \frac{\rho}{\varepsilon_0}$$, $$\nabla \times \mathbf{E} = -\dot {\mathbf{B}}$$, $$\nabla \cdot \mathbf{B} = 0$$, $$\nabla \times \mathbf{B} = \mu_0 (\varepsilon_0 \mathbf{j} + \dot{\mathbf{E}})$$.

Can I follow from this an expression of the form $$\alpha \ddot {\mathbf{E}}+\beta \mathbf{E}=0$$?

Example 3: $$c_1 \cos(\omega t) + c_2 \sin(\omega t)$$ into $$A cos (\omega t + \delta)$$. How do I mark the dependencies, so that $$A$$ is $$A(c_1, c_2)$$ but not $$A(t)$$?

• For your first, look at SolveAlways[a x^2 + b x + c == k (x + α)^2 + β, x]; for the third, look at this. May 28 '20 at 1:32
• Thank you! The first one works well. Is there a shortcut to turn it around, so get k(a,b,c) etc. instead of a(k,α,β) etc.? May 29 '20 at 11:54