The others already have pointed out the problem of your code. But I think it's not bad to say that using 1-D Math input typing usually avoids encountering such mistakes. To type your code in 1-D Math input mode, you should use *
whenever you have a multiplication. For substitution in your code, I prefer to use ReplaceAll
command. And in case your Solve
gives more than one solution, let's say you have a degree two polynomial equation and it gives two different solutions, then you need to tell Mathematica to choose which solution to substitute in your expression. So I prefer to type sol[[1]]
which means the first element of the list of solutions. If you avoid mentioning the index of the solution that you want, then Mathematica will give you a list containing result of the substitution for each of the solutions. So anyway, your code written in 1-D Math input format and my taste will be as the following.
a[b_,x_]:=b*x+1;
sol=Solve[(1+b)*x+1==0,b]
Plot[ReplaceAll[sol[[1]]][a[b,x]],{x,1,1000}]
Running it, you will get the following result.
b
andx
in the definition ofa
. Works fine if you fix that. $\endgroup$