Is every real Lie algebra with an Abelian ideal necessarily a semidirect sum? Reposted from physics.SE. Hope the formulation of the question will be clear as it is. Do let me know in case I should be more clear or precise!
Suppose that we have a physical system with some symmetry, given by a Lie group whose generators are $Q_i$. Suppose that there is a (linearly independent) subset of these generators, $Q_A$, which commute with one another, and in general satisfy the relation
$$
[Q_i,Q_A]=(T_i)^B_{\phantom BA}Q_B,
$$
where the matrices $T_i$ define a representation of the Lie algebra of $Q_i$. Is it always possible to find a basis of the Lie algebra of the form $\{Q_a,Q_A\}$, where the generators $Q_a$ themselves form a closed subalgebra?
An example of such a structure would be the group $\text{ISO}(n)$ of isometries of the $n$-dimensional Euclidean space. Out of its generators, the $n$ translations form an Abelian ideal (my $Q_A$), whereas the $n(n-1)/2$ rotations form a non-Abelian subalgebra (my $Q_a$). The whole group $\text{ISO}(n)$ is a semidirect product of the subgroups of rotations and translations.
I believe that the answer to my question is in general no, but I would love to see some (possibly simple) examples.
 A: The answer is no.
(Background for those reading who aren't familiar with physicists' conventions: it's a common thing in physics to ignore the difference between Lie algebras and Lie groups, and also to ignore the difference between Lie groups with the same Lie algebra; in particular "generators" here means generators of a Lie algebra.) 
I interpret the question to mean the following. Suppose $\mathfrak{g}$ is a (real) Lie algebra and $\mathfrak{a}$ an abelian ideal of it. Is $\mathfrak{g}$ the semidirect product of $\mathfrak{a}$ and $\mathfrak{g}/\mathfrak{a}$, with the adjoint action? Equivalently, does the short exact sequence
$$0 \to \mathfrak{a} \to \mathfrak{g} \to \mathfrak{g}/\mathfrak{a} \to 0$$
split (as a short exact sequence of Lie algebras)? 
Consider the special case where the action of $\mathfrak{g}$ on $\mathfrak{a}$ is as simple as possible: the trivial representation. (So all the $T_i$ are zero.) In this case you're asking whether $\mathfrak{g}$ is a direct product of $\mathfrak{a}$ and $\mathfrak{g}/\mathfrak{a}$, and the answer is no: $\mathfrak{g}$ can be what is called a central extension instead. Such extensions are classified by second Lie algebra cohomology
$$H^2(\mathfrak{g}/\mathfrak{a}, \mathfrak{a})$$
(actually this true even if $\mathfrak{a}$ isn't central, but then it has to be understood as cohomology with nontrivial coefficients). You don't hear about these often in connection with the Lie algebras that show up in physics because $H^2(\mathfrak{g}, -)$ vanishes if $\mathfrak{g}$ is semisimple (this is Whitehead's second lemma), which leads to the Levi decomposition expressing any finite-dimensional real Lie algebra as the semidirect product of a solvable ideal and a semisimple quotient. The decomposition of $\mathfrak{iso}(n)$ you describe is an example of this.
The simplest example of a nontrivial central extension occurs when $\mathfrak{a} \cong \mathbb{R}$ and $\mathfrak{g}/\mathfrak{a} \cong \mathbb{R}^2$; it's given by the Heisenberg Lie algebra of $3 \times 3$ strictly upper triangular matrices 
$$\left[ \begin{array}{ccc} 0 & x & y \\ 0 & 0 & z \\ 0 & 0 & 0 \end{array} \right].$$
More generally, a Lie algebra is nilpotent iff it can be expressed as an iterated central extension of abelian Lie algebras. Examples include the Lie algebra of $n \times n$ strictly upper triangular matrices for all $n$. 
An important class of examples of central extensions, which show up in "physics" for some value of physics, is the affine Lie algebras. 
A: Every (finite-dimensional) Lie algebra $L$ over $\mathbb{R}$ (or any field with characteristic 0) is a semidirect product of its radical $R(L)$ with a copy of $L/R(L)$. That is the theorem of Levi-Mal'tsev. So if your abelian ideal happens to be the radical of the Lie algebra (which is as big as it can get), yes.
In general, no. Counterexample: $L = \{\pmatrix{0&a&c\\0&0&b\\0&0&0}: a,b,c \in \mathbb{R}\}$, and as abelian ideal we take its centre $Z(L) = \{\pmatrix{0&0&c\\0&0&0\\0&0&0}: c \in \mathbb{R}\}$. Note that $L/Z(L)$ is abelian, and since $Z(L)$ is central, a semidirect product of $L/Z(L)$ and $Z(L)$ would actually be a direct product, hence abelian. But $L$ is not abelian.
