# When do I use GenerateConditions and Assumptions with Integrate or Sum?

`Integrate` and `Sum` evaluations return generic solutions. These are usually correct for general cases, but may not apply for specific parameter values (see Generic and Non-Generic Cases).

For example, this summation is unbounded if `x` is greater than or equal to 1:

``````In:= Sum[x^n, {n, 0, Infinity}]

Out=  1 / (1 - x) ``` ```

The `GenerateConditions``->True` option tells the function to state when the solution is valid.

Now we confirm that the result applies only for `Abs[x]<1`:

``````In:= Sum[x^n, {n, 0, Infinity}, GenerateConditions -> True]

Out=  ConditionalExpression[1/(1 - x), Abs[x] < 1] ``` ```

If any condition is known already, the `Assumptions` option can be used to tell `Sum` about it. This gives a simple output suitable for later use in the code. The explicit condition used here will need to be remembered when the result is used:

``````In:= Sum[x^n, {n, 0, Infinity}, Assumptions -> {-1 < x && x < 1}]

Out= 1/(1 - x)   ``` ```

Assumptions can also be passed using the `Assuming` function or `\$Assumptions`:

``````In:= Integrate[1/(x + a), {x, 0, 1}]
````Out= ConditionalExpression[-Log[a] + Log[1 + a],       Re[a] > 0 || Re[a] < -1 ||  NotElement[a, Reals] `
```
In:= Assuming[a > 0, Integrate[1/(x + a), {x, 0, 1}]]``````
````Out= Log[1 + 1/a]`
```
In:= \$Assumptions = a > 0;
Integrate[1/(x + a), {x, 0, 1}] ``````
````Out= Log[1 + 1/a] ` ```

This resets `\$Assumptions` to its default:

``In:= \$Assumptions =. ; ` `

## Contact Support Call us

## Customer Support

Monday–Friday
8am–5pm US Central Time

• Product registration or activation
• Pre-sales information and ordering
• Help with installation and first launch

## Advanced Technical Support (for eligible customers)

Monday–Thursday
8am–7pm US Central Time

Friday
8:30–10am & 11am–5pm US Central Time

• Priority technical support
• Product assistance from Wolfram experts
• Help with Wolfram Language programming