constraint extrema problem (Lagrange function)

30 Views Asked by At

I do not understand one thing in solving constraints extrema problem using Lagrange function. Let us have a function $f(x)$ and a constraint $g(x)=0$ I saw in textbooks solutions using a Lagrange function with a real lagrange multiplier $\lambda$ in the form $$ L(x)=f(x)+\lambda g(x)$$ or $$ L(x)=f(x)-\lambda g(x)$$ How we know which sign to use when?