Is it possible to not differentiate through an undefined variable?

Suppose I have some $ \lambda$ that is a function of $ x$ , and I don’t know exactly what it is yet.

Then, doing the following differentiation D[lamb, x] gives zero. But what I really want is to not have Mathematica evaluate the expression, i.e., just leave it as it is until I know $ \lambda$ later.

Is there a way to achieve this? Thanks!

Update variable value via add_filter

I have this apply filter in my plugin.

$  pre_html = apply_filters( 'events_views_html', null, $  view_slug, $  query, $  context ); 

I want to change $ view_slug value dynamically because I do not want to modify plugin files. Can I do this using add_filter in my child theme ?

It is a basic question but I have limited knowledge of WordPress filters and hooks. Some guidelines regarding this will be appreciated.

How to eliminate a variable from coupled ODEs?

I found this question with an answer: How to eliminate variables in ODE?

With[{f = Function[t, {x'[t] + x[t]/10 + y[t], x[t] - y'[t] + z[t], x[t] + 3 y[t] - z'[t]}]},  With[{ndiff = Function[{exp, t}, Array[D[exp, {t, #}] &, Length[f[t]] + 1, 0]]}, Eliminate[Join @@  ndiff[f[t], t] == 0, Complement[ndiff[f[t], t] // Variables, ndiff[x[t], t]]]]] 

I want to know why is this Array[D[exp, {t, #}] &, Length[f[t]] + 1, 0] created? If I change the Length of the array the solution returns ‘True’.

What does it mean by the error “10 is not a valid variable”?

I wrote a very basic test function in Mathematica (I am the absolute beginner)

Fun1[x_] := Module[ {y, z, t}, y = Min[x + 10000, 500]; z = y + 24; t = y + z; t ] 

However, when I try to solve for the root Solve[Fun1[x] == 0, x], I was never able to get the expected value, but this error occurred "… Solve::ivar: 10 is not a valid variable".

what does it mean? and how to overcome this?

Many thanks Tien

Maximize an expression with respect to a variable and minimize it with respect to other variables

I started to use Mathematica a few time ago. I want to minimize the following expression (function of $ l,p,q,r,c$ ) with respect to variables $ l, p, q, r$ and then maximize the result obtained with respect to variable $ c$ . However, when I try to obtain an expression function of $ c$ to maximize later using Minimize, I do not get any result because it takes too long. How can I solve this issue?

Minimize[{(((l^2/2)*(1-(1/4-c))+(l*p)*(1-1/4)+(l*q)*(1-(1/4+c))+(l*r)*(1-1/2)+(p^2/2)*(1-c)+(p*q)*(1-2*c)+(p*r)*(1-(1/4+c))+(q^2/2)*(1-c)+(q*r)*(1-1/4)+(r^2/2)*(1-(1/4-c)))/((l^2/2)*(1-(1/4-c))+(l*p)*(1-1/4)+(l*q)*(1-(1/4-c))+(l*r)*(1-0)+(p^2/2)*(1-c)+(p*q)*(1-(1/4-c))+(p*r)*(1-0)+(q^2/2)*(1-(1/4-c))+(q*r)*(1-1/4)+(r^2/2)*(1-0))), l >= 1, p >= 0, q >= 0, r >= 0, l + p + q + r == 1000000, 1/7<c<1/5}, {l, p, q, r}] 

Change product_type from simple to variable in WooCommerce

I know that WooCommerce plugin store product_type in taxomony I use that code

// TODO change taxonomy // product_type = variable $  terms = get_the_terms($  post_id, "product_type"); foreach ($  terms as $  term) {     $  termId = $  term->term_id;     // TODO figure out why is not work     wp_update_term($  termId, "variable"); } 

Why it not works?

Using slot and application to variable length vector

I have a list of 2D coordinates with a maximum length of 3, e.g.

peakdatAB {{1007.81, 8.64842}, {1008.38, 8.19264}} 

I need to generate something like this

({PointSize[0.01], Blue, Point[#1], Red, Point[#2], Black, Point[#3]}) & @@ peakdatAB 

but here the problem is the variable length of peakdatAB as when there is say no third point, it returns an error. How can I fix this?

Searching for substring in field that contains variable length of arrays of json objects

I am trying to construct a sql query, that searches for a substring within a field. The issue is that the field contains an array of one or more json objects.

For example the table looks like so:

day     |   items ____________________ Sunday  | [{"apples":5, "bananas":2}, {"pears":12, "cucumbers":9}, ...] Monday  | [{"apples":6, "bananas":1}, {"watermelon": 1}] Tuesday | [{"apples":4, "bananas":3}, {"tomatoes": 1}] 

How do I construct a SQL query that searches for a substring in items given it is not a string ?

Thanks