How to set a function

F(x) = 2x^2-2x-2 при x<=2 F(x) = sqrt(x-1) при x=2 
  • If you are given an exhaustive answer, mark it as correct (a daw opposite the selected answer). - Nicolas Chabanovsky

1 answer 1

To set this function, Piecewise used:

 f[x_] := Piecewise[{{2 x^2 - 2 x - 2, x <= 2}, {Sqrt[x - 1], 2 < x <= 3}}];