# Maximize: specify the range of a parameter

I am trying to do symbolic maximization of a function, and would like to specify the range of a parameter of that function.

I am able to set constraints of the variable I am maximizing over, but am not sure how to set constraints/range for a variable I am not maximizing over.

Here I would like to specify that a is always positive. How can I do that? And can this be done globally?

Maximize[{x^0.5 - a*x, x > 0}, x]


Thanks!

EDIT

A slightly more complicated example, where I am stuck: if I want to specify the exponent symbolically, and want to put a constraint on it (say $0<b<1$?)

Maximize[{x^b - a*x, x > 0}, x]


By putting x^0.5 in your code, Mathematica assumes that you want to use machine arithmetic, and so will not return a result (since a doesn't have a definite numerical value.) If you use x^(1/2) or Sqrt[x] instead, Mathematica will try to solve the problem symbolically instead of numerically, and actually return a symbolic result. This result can then be simplified using Simplify and the appropriate Assumptions:
Maximize[{x^(1/2) - a*x, {x > 0}}, x];

• Simplify[%, a > 0] also works. – J. M.'s technical difficulties Apr 4 '16 at 16:39