My thesis deals with the study of elliptic PDE. It is divided into two parts, the first one concerning a nonlinear equation involving the p-Laplacian, and the second one focused on a nonlocal problem. In the first part, we study the regularity of stable solutions to a nonlinear equation involving the p-Laplacian in a bounded domain. This is the nonlinear version of the widely studied semilinear equation involving the classical Laplacian. Stable solutions to semilinear equations have been very recently proved to be bounded, and therefore smooth, up to dimension n=9 by Cabre, Figalli, Ros-Oton, and Serra. This result is known to be optimal by counterexamples in higher dimensions. In the case of the p-Laplacian, the boundedness of stable solutions is conjectured to hold up to a critical dimension depending on p. Examples of unbounded stable solutions are known if the dimension exceeds the critical one. Moreover, in the radial case or under strong assumptions on the nonlinearity, stable solutions are proved to be bounded in the optimal dimension range. We prove the boundedness of stable solutions under a new condition on n and p, which is optimal in the radial case, and more restrictive in the general one. It improves the known results in the field, and it is the first example, concerning the p-Laplacian, of a technique providing both a result in the nonradial case and the optimal result in the radial case. In the first part, we also investigate Hardy-Sobolev inequalities on hypersurfaces of Euclidean space, all containing a mean curvature term. Our motivation comes from several applications of these inequalities to the study of a priori estimates for stable solutions. Specifically, we give a simplified proof of the celebrated Michael-Simon and Allard inequality, we obtain two new forms of the Hardy inequality on hypersurfaces, and an improved Hardy inequality in the Poincare sense. In the second part of this thesis, we deal with a Dirichlet to Neumann problem arising in a model for water waves. The system is described by a diffusion equation in a slab of fixed height, containing a weight that depends on a parameter a belonging to (-1,1). The top of the slab is endowed with a 0-Neumann condition, while on the bottom we have a Dirichlet datum and an equation involving a smooth nonlinearity. The system can also be reformulated as a nonlocal problem on the component endowed with the Dirichlet datum, by defining a suitable Dirichlet to Neumann operator. First, we prove a Liouville theorem that establishes the one dimensional symmetry of stable solutions, provided that a control on the growth of the energy associated with the problem is satisfied. As a consequence, we obtain the 1D symmetry of stable solutions to our problem in dimension 2. For n=3, we establish sharp energy estimates for both the energy minimizers and the monotone solutions, deducing the 1D symmetry of these classes of solutions, by an application of our Liouville theorem. Concerning this problem, we also investigate the nature of the associated Dirichlet to Neumann operator. First, we deduce its expression as a Fourier operator, which was known only in the case a=0. This result highlights the mixed nature of the operator, which is nonlocal, but not purely fractional. To better understand the dual behaviour of the operator, we provide a G-convergence result for an energy functional associated with the operator. Specifically, as a G-limit of our energy functional we find a mere interaction energy when a is greater than 0, and the classical perimeter when a is smaller or equal than 0. We point out that the threshold a=0 that we obtain here, as well as the G-limit behaviour for nonpositive values of a, is common to other nonlocal problems treated in the literature. On the contrary, the limit functional that we obtain in the other case appears to be new and structurally different from other nonlocal energy functionals that have been investigated in the literature.