Plotting the expression in 2D form

I'm plotting this function.

Plot[rs + ts+ s, {r == 2},{t==3} {s, 2, 5}] or

[{t=3, r=2}, Plot[ r s + t s + s, {s, 2, 5}]]


When I substitute the value of "r" in the expression then its plot graph, but for unknown "r and t" in expression and further declaration the value of "r and t", its unable to draw.

Is there any alternate method to plot the expressions with given fixed values of some variable and with given range of some other variable.

• You mean something like With[{t=3, r=2}, Plot[ r s + t s + s, {s, 2, 5}]]? – Kuba Nov 19 '17 at 20:05
• yes sir, but its not still working Kuba – Dauood Saleem Nov 19 '17 at 20:15
• It's unclear what you're asking. Do you mean you want to plot a surface? e.g. With[{t=3}, Plot3D[ r s + t s + s, {r, 0, 2}, {s, 2, 5}]] – b3m2a1 Nov 19 '17 at 20:31
• Welcome to Mathematica StackExchange. In order to learn how to use this site take the tour. When copying equations from a notebook to your question one should format using inline code by selecting the code and clicking the {} button above the edit window. It is recommended that you browse the Markdown help – Jack LaVigne Nov 19 '17 at 22:01
• Thank you so much, sir. – Dauood Saleem Nov 20 '17 at 9:15

If you want r and t to vary, you can try this

Manipulate[Plot[r s + t s + s, {s, 2, 5}], {r, 1, 4}, {t, 0, 5}]

• Thank you so much sir, Bill Watts. – Dauood Saleem Nov 20 '17 at 8:57

Another possibility would be to define a function that computes the expression with input arguments that include the parameters r and t.

f[s_, r_, t_] := r s + t s + s


Now when you plot it set the value of the variables, r=2, t=3.

Plot[f[s, 2, 3], {s, 2, 5}]


• Thank you so much sir, Jack LaVigne. – Dauood Saleem Nov 20 '17 at 9:05