newbie to MMA.
After computing the following two integrals:
min1 = 0;
min2 = 0;
max1 = 1.00;
max2 = 1.00;
density = (1/(max1 - min1)) (1/(max2 - min2));
Integrate[(2 x1 - max1) density Boole[
x1 + x2 >= s >= 0 && x1 >= p1 >= 0 && min1 <= x1 <= max1 &&
min2 <= x2 <= max2], {x1, min1, max1}, {x2, min2, max2}];
b1 = Part[%, 1];
g1[s_] := Piecewise[b1, 0];
Integrate[(2 x2 - max2) density Boole[
x1 + x2 >= s >= 0 && x2 >= p2 >= 0 && min1 <= x1 <= max1 &&
min2 <= x2 <= max2], {x1, min1, max1}, {x2, min2, max2}];
b2 = Part[%, 1];
g2[s_] := Piecewise[b2, 0];
It returns "Nonatomic expression expected at position 1 in Last[0]. " when I try to add them up:
d1 = Simplify[g1[s_] + g2[s_]]
The sum works if I eliminate x1 >= p1 >= 0 and x2 >= p2 >= 0 respectively, but I cannot figure out why it does not work after including these two conditions.
- As you receive help, try to give it too, by answering questions in your area of expertise.
- Take the tour and check the faqs!
- When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign!
– May 26 '16 at 13:09