# Equation Solving: Solution in terms of predefined functions

Is there a way that I can have Mathematica give me the solution of a problem it has solved in terms of functions that I have predefined? The specific problem I'm trying to solve is:

s = alp^2 (E0*mu1 + N01);
k = 1 - E^(-Pmax/s^2) + Sqrt[π*Pmax]/(2*s)*Erfc[Sqrt[Pmax]/s];

E1 = s^2 (1 - E^(-Pmax/s^2));

epsd = E1 - (s*k)^2;

A = 1 + epsd/((k*alp)^2 N01);

c = E1/(N01*(k*alp)^2);

SIG1 = (E0*mu1)/N01; SIG2 = (E1*mu2)/N02;

D[1 - 2 E^(-((A SNRth)/SIG1)) Sqrt[(c SNRth)/(SIG1 SIG2)]
BesselK[1, 2 Sqrt[(c SNRth)/(SIG1 SIG2)]], {alp}]


The solution given by Mathematica is extremely lengthy. However, by observation it can be seen that many of the functions that I have defined above the differentiation operator are contained within the solution.

-
E.g. Simplify[x^3 + 3 x^2 - 2 x + 1, f[x] == x^3 + 1 && g[x] == 3 x^2 - 2 x] yields f[x] + g[x]. This can be adjusted to more specific cases. There are another ways to get expected results, but until no examples are given we won't be able to help more. – Artes Oct 2 '13 at 12:25
@DaveS: please add that to your question (edit), so that future users can directly see it. Thank you! – Pinguin Dirk Oct 2 '13 at 12:30
@Artes I'm sorry, I'm new to this forum. Is there a way I can directly copy Mathematica code into my question? – Dave S Oct 2 '13 at 12:38
@DaveS Perhaps this post could be useful Additional useful buttons for our M.SE editor but I've never used it. – Artes Oct 2 '13 at 12:48