What is the definition of the domain of composite partial functions?

In calculus books they define the domain(natural domain) of $f+g$ as $Dom(F)\bigcap Dom(g)$. And they define the domain of $fog$ as the set of all real numbers $x$ such that $x$ is in the domain of the function $g$ and $g(x)$ is in the domain of the function $f$. Is it how they define the domain of $f+g$ or $fog$ as partial functions in very formal mathematics?Can you suggest any books I can see the formal definitions of domain , source and compositions of partial functions in details?

For partial functions $f : X \rightharpoondown Y$ and $g : Y \rightharpoondown Z$, you can define $g \circ f : X \rightharpoondown Z$ in the 'only way that makes sense', i.e. for $x \in X$ put $$(g \circ f)(x) = \begin{cases} g(f(x)) & \text{if}\ x \in \text{dom}(f)\ \text{and}\ f(x) \in \text{dom}(g)\\ \text{undefined} & \text{otherwise} \end{cases}$$
Thus $\text{dom}(g \circ f) = \text{dom}(f) \cap f^{-1}[\text{dom}(g)]$.
And just like for total functions, $\text{dom}(f+g)=\text{dom}(f) \cap \text{dom}(g)$, presuming $+$ makes sense.