# How to solve this equation numerically? [closed]

Two Gaussian functions: f1,f2 of the form f1 = a1*Exp[-t^2/s1^2]. Total area, Atot of (f1+f2) is known. Height of each peak (a1 and a2) is known (experimental data). I don't want to experimentally determine FWHM, although it could be done. Integration gives:

Atot=Sqrt[2 π] (a1 s1 Erf[1/(Sqrt s1)] + a2 s2 Erf[1/(Sqrt s2)])


By plotting the function for Atot, I know this has four solutions for variables {s1,s2} for a given Atot, a1, and a2. However, constraint is that s1 and s2 both > 0, which yields one unique solution. (i.e. Atot = 1.1001, a1 = 0.382, a2 = 0.384)

How to solve in Mathematica?

## closed as off-topic by Daniel Lichtblau, corey979, MarcoB, m_goldberg, LCarvalhoMar 18 at 11:13

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question cannot be answered without additional information. Questions on problems in code must describe the specific problem and include valid code to reproduce it. Any data used for programming examples should be embedded in the question or code to generate the (fake) data must be included." – Daniel Lichtblau, corey979, MarcoB, LCarvalho
If this question can be reworded to fit the rules in the help center, please edit the question.

• Two unknowns require two equations. You need another one involving s1 and s2. – J. M. will be back soon Mar 17 at 12:38
• In addition to what was noted by @J.M., it looks like the total area is not accounting for overlap. It is not obvious from the problem statement whether that is what you want. – Daniel Lichtblau Mar 17 at 13:47

As stated in the comments, the solution is not unique!

This code gives a range of values where both $$s_1$$ and $$s_2$$ are positive (there are other ranges also).

Atot[a1_, a2_][s1_, s2_] :=
Sqrt[2 \[Pi]] (a1 s1 Erf[1/(Sqrt s1)] + a2 s2 Erf[1/(Sqrt s2)]);
Manipulate[
With[
{s1 = q}, FindRoot[Atot[.382, .384][s1, s2] - 1.01, {s2, 1}]
], {q, .255, .735}
]


For example ($$s_1 = .255$$ and $$s_2 = 7.70763$$) or ($$s_1=0.5$$ and $$s_2=0.660332$$), etc. 