Can I use a variable which has a non-linear relationship to the dependent variable in logistic regression? Let's say I am building a logistic regression model where the dependent variable is binary and can take the values $0$ or $1$. Let the independent variables be $x_1, x_2, ..., x_m$ - there are $m$ independent variables. Let's say for the $k$th independent variable, the bivariate analysis shows a U-shaped trend - i.e., if I group $x_k$ into $20$ bins each containing roughly equal number of observations and calculate the 'bad rate' for each bin - # observations where y = 0 / total observations in each bin - then I get a U shaped curve.
My questions are:


*

*Can I directly use $x_k$ as input while estimating the beta parameters? Are any statistical assumptions violated which might cause significant error in estimating the parameters?

*Is it necessary to 'linearize' this variable through a transformation (log, square, product with itself, etc.)?

 A: Just like linear regression, logistic regression and more generally generalized linear models are required to be linear in the parameters but not necessarily in the covariates.  So polynomial terms like a quadratic that Macro suggests can be used.  This is a common misunderstanding of the linear term in generalized linear models.  Nonlinear models are models that are nonlinear in the parameters. If the model is linear in the parameters and contains additive noise terms that are IID the model is linear even if there are covariates like X$^2$ log X or exp(X). 
As I now read the question it seems to be edited.  My specific answer would be yes to 1 and not necessary to 2.
A: You would want to use a flexible formulation that would capture non-linearity automatically, e.g., some version of a generalized additive model. A poor man's choice is a polynomial $x_k$, $x_k^2$, ..., $x_k^{p_k}$, but such polynomials produce terrible overswings at the ends of the range of their respective variables. A much better formulation would be to use (cubic) B-splines (see a random intro note from the first page of Google here, and a good book, here). B-splines are a sequence of local humps:
http://ars.sciencedirect.com/content/image/1-s2.0-S0169743911002292-gr2.jpg
The height of the humps is determined from your (linear, logistic, other GLM) regression, as the function you are fitting is simply
$$ \theta = \beta_0 + \sum_{k=1}^K \beta_k B\Bigl( \frac{x-x_k}{h_k} \Bigr) $$
for the specified functional form of your hump $B(\cdot)$. By far the most popular version is a bell-shaped smooth cubic spline:
$$
B(z) = \left\{ \begin{array}{ll} \frac14 (z+2)^3, & -2 \le z \le -1 \\ \frac14 (3|x|^3 - 6x^2 +4 ), & -1 < x < 1 \\ \frac14 (2-x)^3, & 1 \le x \le 2 \\ 0, & \mbox{otherwise} \end{array} \right.
$$
On the implementation side, all you need to do is to set up 3-5-10-whatever number of knots $x_k$ would be reasonable for your application and create the corresponding 3-5-10-whatever variables in the data set with the values of $B\Bigl( \frac{x-x_k}{h_k} \Bigr) $. Typically, a simple grid of values is chosen, with $h_k$ being twice the mesh size of the grid, so that at each point, there are two overlapping B-splines, as in the above plot.
A: Another viable alternative that the modeling shop I work for routinely employs, is binning the continuous independent variables and substituting the 'bad rate'.  This forces a linear relationship.
