# Plot a function with different values of a parameter on the same plot

I want to plot the following function with different values of the parameter \$b\$:

```` a = -0.1 Sqrt[0.001^2 + b^2];   M[t_] := NIntegrate[10w E^(-w/50)((1-Cos[(w+a)t])/(w+a)^2),{w,0,-a,∞},   MaxRecursion -> 100, AccuracyGoal -> 10, Method -> "PrincipalValue"]   Plot[M[t],{t,0,1000}] `
```

How can I code different plots for different values of parameter \$b\$ in a single plot?

Note: My actual code is pretty bigger than this. So I cannot define a new series of variables and functions for each value of the parameter and then plot them simultaneously.

Replay

Following J.M.'s comment (his credit)

``````M[t_, b_] :=  With[{a = -0.1 Sqrt[0.001^2 + b^2]},
NIntegrate[10 w E^(-w/50) ((1 - Cos[(w + a) t])/(w + a)^2), {w,
0, -a, ∞}, MaxRecursion -> 100, AccuracyGoal -> 10,
Method -> "PrincipalValue"]]
```
```

Then

`````` Plot[ Table[M[t, b], {b, 1, 2}]//Evaluate, {t, 0, 1}]
```
```
Category: plotting Time: 2016-07-29 Views: 0