guptaaa3
(Aakash Gupta)
December 10, 2021, 11:13am
1
I am trying to evaluate an expression using “Abs” but for some reason it does not simplify beyond a point. Am I doing something wrong in here? My command is:
Refine[Abs[k1*I + 1], Element[k1, PositiveReals]]
The output I am getting:
Abs[1 + I k1]
I expected:
Sqrt[1+k1^2]
Try:
Simplify[Abs[k*I + 1] // ComplexExpand, Assumptions -> Element[k, PositiveReals]]
(* Sqrt[1 + k^2] *)
neils
(Neil Singer)
December 10, 2021, 5:09pm
3
You can also just use ComplexExpand because it assumes all variables are real unless specified as complex:
ComplexExpand[Abs[k1*I + 1]]
Mariusz’s post is better if there are further simplifications from the fact that k is Positive (which in your particular example does not matter).
Regards.