# Spotting and condensing expressions in output

I am running some symbolic scripts to generate a model problem. One of my outputs is

This is generated by the Mathematica code

or, in Mathematica format (owing to the fancy lettering and formatting used)

Subscript[
\!$$\*UnderscriptBox[\(\[ScriptCapitalB]$$, $$_$$]\),
i] = {0, 0,
Subscript[\[ScriptCapitalB],
z][\[ScriptX], \[ScriptY], \[ScriptT]]} +
Curl[{0,
0, \[ScriptCapitalA][\[ScriptX], \[ScriptY], \[ScriptT]]}, {\
\[ScriptX], \[ScriptY], \[ScriptZ]}];
Subscript[
\!$$\*UnderscriptBox[\(\[ScriptCapitalB]$$, $$_$$]\),
a] = {Subscript[\[ScriptCapitalB], a][\[ScriptT]] Cos[\[Phi]],
Subscript[\[ScriptCapitalB], a][\[ScriptT]] Sin[\[Phi]], 0};

\!$$\*UnderscriptBox[\(\[ScriptCapitalB]$$, $$_$$]\) = Subscript[
\!$$\*UnderscriptBox[\(\[ScriptCapitalB]$$, $$_$$]\), a] + Subscript[
\!$$\*UnderscriptBox[\(\[ScriptCapitalB]$$, $$_$$]\), i];
Subscript[
\!$$\*UnderscriptBox[\(\[ScriptR]$$, $$_$$]\),
w] = {Subscript[\[ScriptX], w][\[ScriptS]],
Subscript[\[ScriptY], w][\[ScriptS]], \[ScriptZ]};
VectorNorm[vec_] := Sqrt[vec . vec];
UnitVector2[vec_] := vec/VectorNorm[vec];
UnitTangent[vec_, param_] := UnitVector2[D[vec, param]]
UnitNormal[vec_, param1_, param2_] :=
UnitVector2[D[vec, param1]\[Cross]D[vec, param2]] ;
NormalNorm[vec_, param1_, param2_] :=
VectorNorm[(D[vec, param1]\[Cross]D[vec, param2])];
Subscript[
\!$$\*UnderscriptBox[\(\[ScriptN]$$, $$_$$]\), w] =
FullSimplify[UnitNormal[Subscript[
\!$$\*UnderscriptBox[\(\[ScriptR]$$, $$_$$]\),
w], \[ScriptZ], \[ScriptS]]];
magFieldNormalWall =  FullSimplify[
\!$$\*UnderscriptBox[\(\[ScriptCapitalB]$$, $$_$$]\) . Subscript[
\!$$\*UnderscriptBox[\(\[ScriptN]$$, $$_$$]\), w]]


However, it is often more convenient to write the final two terms as

$$\dfrac{\partial A}{\partial x}\dfrac{\partial x_{w}}{\partial s}+\dfrac{\partial A}{\partial y}\dfrac{\partial y_{w}}{\partial s}=\dfrac{\partial A}{\partial s}$$

but I don't know how to make Mathematica think "this expression looks like the above so let's write it as that". Is there an easy way to get Mathematica to "reverse simplify" an expression by condensing it into a more convenient form?

• Please include Mathematica code for this expression so that someone is able to help you further. Thanks.
– Syed
Jan 4, 2022 at 9:52
• Please include copy-paste-able code, not its picture. You can copy directly from the input cell and paste in the Edit window where there is a braces button { } to help you format it. Thanks.
– Syed
Jan 4, 2022 at 10:10
• Prior to copy and paste convert cells to Raw InputForm or at least InputForm Jan 4, 2022 at 16:20
• Jan 4, 2022 at 19:35