# Simplifications assuming function is a probability distribution

Is it possible to define a generic probability distribution function (pdf) so Mathematica can use its properties to simplify expressions?

For example:

Simplify[Integrate[f[x],{x,-Infinity,Infinity}]]

How to tell to Mathematica that f[x] is a PDF so it can simplify (in this case) to 1?

This is easy for a PDF from a given distribution, but my question is about the case of a generic PDF f[x]

ProbabilityDistribution does precisely that.

https://reference.wolfram.com/language/ref/ProbabilityDistribution.html

• Yes, it's true that you can use something like ProbabilityDistribution[f[y], {y, -Infinity, Infinity}] for a generic f[x], and it works. I didn't see that on the examples, so I assumed that was not possible. Do you know if is it possible to assume further conditions, for example, that f[x] is a continuous distribution? So it can simplify even further (for example, Simplify[ Integrate[f[y], {y, -Infinity, 10}] + Integrate[f[y], {y, 10, Infinity}]]) Nov 24, 2022 at 12:17
• Just define your f(x) to be continuous. Nov 24, 2022 at 18:04
\$Version

(* "13.1.0 for Mac OS X x86 (64-bit) (June 16, 2022)" *)

Clear["Global*"]


Use TagSet or TagSetDelayed to associate the integral to the symbol f, e.g.,

f /: Integrate[f[x_], {x_, -Infinity, Infinity}] = 1;


Then

Integrate[f[y], {y, -Infinity, Infinity}]

(* 1 *)


EDIT:

Mathematica doesn't combine integrals unless explicitly told to do so. Define a rule

intRule = Integrate[expr_, {t_, a_, b_}] +
Integrate[expr_, {t_, b_, c_}] :>
Integrate[expr, {t, a, c}];


Applying the rule,

Integrate[f[y], {y, -Infinity, 10}] +
Integrate[f[y], {y, 10, Infinity}] /. intRule

(* 1 *)

• It works for that integration, but not for other. For example, Simplify[ Integrate[f[y], {y, -Infinity, 10}] + Integrate[f[y], {y, 10, Infinity}]]` does not simplify to 1. Nov 24, 2022 at 12:08