# Calculating the cohomology groups of the intersection of two submanifolds

Suppose we have a manifold $X$ and two submanifolds $A,B\subseteq X$. If we already know the cohomology groups $H^*(X)$, $H^*(A)$, and $H^*(B)$, is there any way we could use this information to simplify the computation of $H^*(A\cap B)$?

Clearly there can't be any straight formula between the cohomologies; If $X=\mathbb{R}^2$ and $A$ is a half-plane while $B$ is a circle, then depending on the position of $B$ in $\mathbb{R}^2$, the rank of $H^1(A\cap B)$ could be either $1$ or $0$.

Even still, it is possible that the knowledge of $H^*(X)$, $H^*(A)$, and $H^*(B)$ could help avoid the full direct computation of $H^*(A\cap B)$, so I would be interested to hear of any such strategy. I would also be interested if there is some restriction one could place on the intersection of $A$ and $B$ that could make this calculation easier, e.g., if the intersection is transverse.

If $A,B$ are open in $X$ such that $A\cup B=X$ you can use the Mayer-Vietoris formula.