Skip to content

Simplifications Involving Absolute value #181

Open
@andrew-murdza

Description

@andrew-murdza

Piecewise definition:

  • |-x|->|x|
  • {match:'|x|',replace:'x',condition:'x\ge0'} (e.g. |x^2|)
  • {match:'|x|',replace:'-x',condition:'x\le0'} (e.g. |1-\sqrt{2}|)

Products and Quotients:

  • {match:'|xy|',replace:'x|y|',condition:'x\ge0'}
  • {match:'|xy|',replace:'-x|y|',condition:'x\le0'}
  • {match:'|\frac{x}{y}|',replace:'\frac{x}{|y|}',condition:'x\ge0'}
  • {match:'|\frac{x}{y}|',replace:'-\frac{x}{|y|}',condition:'x\le0'}
  • |xy|->|x||y| or |x||y|->|xy| (choose 1) helps with stuff like |x|x
  • |\frac{x}{y}|->\frac{|x|}{|y|} or \frac{|x|}{|y|}->|\frac{x}{y}| (choose 1)

Powers:

  • {match:'|x|^n',replace:'x^n',condition:'n is an even integer'}
  • {match:'|x|^{\frac{n}{m}}',replace:'x^{\frac{n}{m}}',condition:'n is an even integer and m is an odd integer'}
  • {match:'|x^n|', replace:'|x|^n',condition:'n is not an even integer or a rational with even numerator and odd denominator'}

Even functions:

  • \cos(|x|)->\cos(x)
  • \sec(|x|)->\sec(x)
  • \cosh(|x|)->\cosh(x)
  • \sech(|x|)->\sech(x)
  • Even better: {match:'f(|x|)',replace:'f(x)',condition:'f is even'}

Odd functions:

  • |\sin(x)|->\sin(|x|)
  • |\tan(x)|->\tan(|x|)
  • |\cot(x)|->\cot(|x|)
  • |\csc(x)|->\csc(|x|)
  • |\arcsin(x)|->\arcsin(|x|)
  • |\arctan(x)|->\arctan(|x|)
  • |\arccot(x)|->\arccot(|x|)
  • |\arccsc(x)|->\arccsc(|x|)
  • |\sinh(x)|->\sinh(|x|)
  • |\tanh(x)|->\tanh(|x|)
  • |\coth(x)|->\coth(|x|)
  • |\csch(x)|->\csch(|x|)
  • |\arcsinh(x)|->\arcsinh(|x|)
  • |\arctanh(x)|->\arctanh(|x|)
  • |\arccoth(x)|->\arccoth(|x|)
  • |\arccsch(x)|->\arccsch(|x|)
  • Even better: {match:'|f(x)|',replace:'f(|x|)',condition:'f is odd'}

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions